You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of v0.8.0, all sections of the inp file that are accessed via the model.inp API are Pandas DataFrames. I think this has been great for most of the inp sections. However, there are some that I think might be better represented as dataclasses, or potentially as custom objects.
For example, the [OPTIONS] section:
If we want to change the REPORT_STEP for a particular simulation, we need to update it like so
# instantiate a modelmodel=swmmio.Model('model.inp')
# change the report stepmodel.inp.options.loc['REPORT_STEP'] ='00:15:00'
Not the worst thing, but I think it might be nicer if the model.inp.options section was represented as dataclass, making the REPORT_STEP editable via dot notation, like this:
model.inp.options.report_step='00:15:00'
This could also make the user experience better, by giving users tab-completion on all of the available attributes of the [OPTIONS] section.
We could also extend this idea to make the data types of the attributes of the [OPTIONS] section more appropriate. For example,
Finally, we could even add [OPTIONS] getters/setters to make the simulation and reporting datetime ranges more easy to work with. For example, we could add start_datetime, end_datetime, and report_start_datetime properties to the model.inp.options object. This would make the process of adjusting the simulation times change from this:
And of course, under the hood, swmmio would still represent this information appropriately in the inp file, so that the we can save the model, then run it as usual.
Thoughts?
Would this make things easier for anyone? This would represent a breaking change, since the public model.inp.options object would be changing. Is it worth it? Either way, I would suggest releasing such a change in v1.0.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As of v0.8.0, all sections of the inp file that are accessed via the
model.inp
API are Pandas DataFrames. I think this has been great for most of the inp sections. However, there are some that I think might be better represented as dataclasses, or potentially as custom objects.For example, the
[OPTIONS]
section:If we want to change the REPORT_STEP for a particular simulation, we need to update it like so
Not the worst thing, but I think it might be nicer if the
model.inp.options
section was represented as dataclass, making the REPORT_STEP editable via dot notation, like this:This could also make the user experience better, by giving users tab-completion on all of the available attributes of the
[OPTIONS]
section.We could also extend this idea to make the data types of the attributes of the
[OPTIONS]
section more appropriate. For example,Finally, we could even add [OPTIONS] getters/setters to make the simulation and reporting datetime ranges more easy to work with. For example, we could add
start_datetime
,end_datetime
, andreport_start_datetime
properties to themodel.inp.options
object. This would make the process of adjusting the simulation times change from this:to this
And of course, under the hood, swmmio would still represent this information appropriately in the inp file, so that the we can save the model, then run it as usual.
Thoughts?
Would this make things easier for anyone? This would represent a breaking change, since the public
model.inp.options
object would be changing. Is it worth it? Either way, I would suggest releasing such a change in v1.0.Beta Was this translation helpful? Give feedback.
All reactions