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

why can't epsg be cast to int as before? (change #188 broke my code) #200

Closed
klwalker-sb opened this issue Apr 11, 2023 · 3 comments
Closed

Comments

@klwalker-sb
Copy link

klwalker-sb commented Apr 11, 2023

Prepare.py line 166: assert isinstance(out_epsg, int), f"out_epsg not found. {out_epsg=}"`
now returns an error:

AssertionError: out_epsg not found. out_epsg='8858'

because my epsg (and thus out_epsg) is originally cast as a string. I cannot simply set it as an int initially because it is manipulated by a different code that I cannot change. The script ran fine for me with the same parameters prior to change #188 because it would cast it to an int. Why can't it continue to cast to int?

@klwalker-sb klwalker-sb changed the title why can't epsg be int? (change #188 broke my code) why can't epsg be cast to int as before? (change #188 broke my code) Apr 11, 2023
@TomAugspurger
Copy link
Contributor

Do you have a minimal example you can share?

@klwalker-sb
Copy link
Author

The issue is pretty straightforward -- if epsg is passed to prepare.prepare_items as a string (e.g. '8858'), the code breaks with the new integer check at line 166. I was passing epsg as a string due to demands of upstream code and possibly different versions of pyproj. I was just wondering why a string could not be allowed to be recast as an integer as before. No worries, though. I fixed things upstream, so you can close this if it is not helpful.

@gjoseph92
Copy link
Owner

As specified in the docs, the epsg parameter was always expected to be an int. The fact that a string happened to work before was undefined behavior and not something to rely on, so I don't think this is a bug. Casting to an int yourself would be the right approach, so glad that worked for you.

@gjoseph92 gjoseph92 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2023
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

3 participants