Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EN_openX function #758

Merged
merged 5 commits into from
Oct 17, 2023
Merged

Add EN_openX function #758

merged 5 commits into from
Oct 17, 2023

Conversation

LRossman
Copy link
Collaborator

@LRossman LRossman commented Oct 4, 2023

EN_openX() allows an EPANET input file to be opened even if it has errors. This required re-arranging code, mainly in input3.c, so that default values are assigned to an object before its input line is parsed. Also a new function, validateproject(), placed in the new code module validate.c, is used to check for valid tank levels and pump curve coefficients that were formerly made in input2.c.

EN_openX allows an EPANET input file to be opened even if it has errors. This required re-arranging code, mainly in input3.c, so that default values are assigned to an object before its input line is parsed.
@LRossman LRossman merged commit 5fd17af into dev Oct 17, 2023
6 checks passed
@LRossman LRossman deleted the dev-EN_openX branch October 25, 2023 13:41
@lbutler
Copy link
Contributor

lbutler commented Jan 3, 2024

@LRossman a very minor comment from me - I noticed that as part of this update you removed the undocumented ability to set the demand multiplier from within the [DEMAND] section.

The code that has been removed from input3.c is below:

EPANET/src/input3.c

Lines 801 to 807 in 7b64012

// If MULTIPLY command, save multiplier
if (match(parser->Tok[0], w_MULTIPLY))
{
if (y <= 0.0) return setError(parser, 1, 213);
else hyd->Dmult = y;
return 0;
}

The only reason I know this exists is because we expectability ran into it affecting junction demands with ids start with the id mult*.

Interestingly this multiplier work with the GUI, but only with the keyword MULTIPLY, not MULT in the toolkit.

I was originally going to suggest maybe we depreciate it because it was causing issues with junctions but you've already done it here.

So my suggestion is that we include a note in the README that this undocumented feature was removed and that the multiplier be set inside the options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants