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
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?
The text was updated successfully, but these errors were encountered:
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
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.
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.
Prepare.py line 166:
assert
isinstance(out_epsg, int), f"out_epsg
not found. {out_epsg=}"`now returns an error:
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?
The text was updated successfully, but these errors were encountered: