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

load_file() ignores "Unit: …" comment #121

Open
khaeru opened this issue Jan 30, 2024 · 0 comments
Open

load_file() ignores "Unit: …" comment #121

khaeru opened this issue Jan 30, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@khaeru
Copy link
Owner

khaeru commented Jan 30, 2024

iiasa/message_data#529 appears to be due to a file that contains a "# Unit: …" comment in its header (here, related to iiasa/message_data#522), but which is ignored by a direct call to genno.operator.load_file(). The Quantity that results is dimensionless instead of having the stated units.

@ravitby and I suspect this could be due to some non-printing characters or other issues in the file which prevent the unit line from being recognized or parsed correctly.

As a mitigation, we gave the explicit keyword argument load_file(…, units="Gp km /a"), which seemed to resolve the error due to the missing units.

@khaeru khaeru added the bug Something isn't working label Jan 30, 2024
@khaeru khaeru self-assigned this Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant