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

Document depreciation of MULTIPLY inside [DEMANDS] section of INP #765

Closed
lbutler opened this issue Jan 9, 2024 · 1 comment · Fixed by #766
Closed

Document depreciation of MULTIPLY inside [DEMANDS] section of INP #765

lbutler opened this issue Jan 9, 2024 · 1 comment · Fixed by #766

Comments

@lbutler
Copy link
Contributor

lbutler commented Jan 9, 2024

In epanet 2.2 it was possible to set the demand multiplier inside the [DEMANDS] section of the input file.

[DEMANDS]
   MULTIPLY  factor
   node  base_demand  (pattern)

This was not a documented feature, and it was only mentioned inside the source code in input3.c here:

EPANET/src/input3.c

Lines 771 to 781 in 7b64012

int demanddata(Project *pr)
/*
**--------------------------------------------------------------
** Input: none
** Output: returns error code
** Purpose: processes node demand data
** Format:
** [DEMANDS]
** MULTIPLY factor
** node base_demand (pattern)
**

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 unexpectedly ran into it throwing error 213 in junction with ids of mult* and demand 0.

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 it’s already been done in PR #758.

My suggestion now is that we include a note in ReleaseNotes2_3.md that this undocumented feature was removed and that the multiplier now must be set inside [OPTIONS] - we can also clean up some remaining constants in text.h

@lbutler
Copy link
Contributor Author

lbutler commented Jan 9, 2024

I had a look through and checked to see if there was anything else missing in ReleaseNotes2_3.md and there were a couple of items.

I'm going to open a PR soon with the following updates:

  • Setting the demand multiplier within the [DEMANDS] section of INP has been depreciated, please use DEMAND MULTIPLIER inside [OPTIONS] instead.
  • EN_PRESS_UNITS can now be used with EN_getoption and EN_setoption to get or set the pressure unit used in EPANET. (Reference PR Get and set pressure units in toolkit #719)
  • Continuous barrier functions were added to constrain emitter flows to allowable values (Reference PR Use barrier functions for PDA & emitters #721)
  • The EN_openx function has been added to enable the opening of input files with formatting errors through the API. This allows users to continue using toolkit functions even when such errors are present. (Reference PR Add EN_openX function #758)

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 a pull request may close this issue.

1 participant