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 Type column to model.links (geo)dataframe #244

Open
aerispaha opened this issue Jan 27, 2025 · 1 comment
Open

Add Type column to model.links (geo)dataframe #244

aerispaha opened this issue Jan 27, 2025 · 1 comment
Milestone

Comments

@aerispaha
Copy link
Member

For several use-cases, it would be useful to be able to discern the type of link in each row that is returned by the swmmio.Model.links.dataframe (and geodataframe). As discussed here, we will likely benefit from an additional Type column in the links (geo)dataframe.

A similar thing is true for the swmmio.Model.nodes dataframe.

Proposal

Add a new column to swmmio.Model.links.dataframe and swmmio.Model.links.geodataframe that encodes the type of link in each row (e.g. Conduit, Pump, Weir, etc.)

Considerations

  • Because this would be a special column, not derived from tabular data in the inp file, we should maybe consider a different style/syntax for the column name. Perhaps snake cased link_type
  • We should be sure that this column doesn't clash with any existing column names. To achieve this, we might consider prepending the column name with dunders or a special swmmio_ string.
  • We could also consider multi-indexing these dataframes, adding a link type index dimension. I expect this might cause some ripple effects though
@wraseman
Copy link

@aerispaha, I agree that it would be nice to be able to get the link or node type from the dataframe / geodataframe associated with swmmio.Model.links and swmmio.Model.nodes. One note is that I have noticed that sometimes the Type column does appear in the swmmio dataframe. I am not sure in what cases the Type column shows up (e.g., difference between SWMM, PCSWMM, etc.). I like the idea of creating a special column naming convention to avoid potential naming conflicts.

@bemcdonnell, any thoughts on naming convention?

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

No branches or pull requests

2 participants