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

Unexpected type for model.crs #239

Open
wraseman opened this issue Jan 3, 2025 · 1 comment
Open

Unexpected type for model.crs #239

wraseman opened this issue Jan 3, 2025 · 1 comment

Comments

@wraseman
Copy link

wraseman commented Jan 3, 2025

When working with GeoDataFrames, the coordinate reference system (CRS) is stored as a pyproj.CRS object: geopandas.GeoDataFrame.crs. So in swmmio, I expected to get the same behavior when calling model.crs and model.links.geodataframe.crs. However, I realized that the first returns a str and the second returns pyproj.CRS.

Example:

from swmmio.examples import philly
import copy

model = copy.deepcopy(philly)

print(f'Data type of model.crs: {type(model.crs)}')
print(f'Data type of model.links.geodataframe.crs: {type(model.links.geodataframe.crs)}')

Output:

Data type of model.crs: <class 'str'>
Data type of model.links.geodataframe.crs: <class 'pyproj.crs.crs.CRS'>

I could see a benefit to aligning model.crs with the GeoPandas convention. Thoughts?

@aerispaha
Copy link
Member

aerispaha commented Jan 5, 2025

I think I agree with that - we ought to follow the convention in GeoPandas. On a related note, I'd also like us to add type hints on all the public functions/methods, per #240.

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

No branches or pull requests

2 participants