-
Notifications
You must be signed in to change notification settings - Fork 0
Fix unit conversion #41
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
base: dev
Are you sure you want to change the base?
Conversation
Unit is turned back to input unit if conversion does not take place. Foreign keys are added and converted later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from one part which I don't quite unserstand, I think this is a good solution.
data_adapter/preprocessing.py
Outdated
except TypeError: # occurs for foreign keys | ||
# rewrite unit as conversion did not take place | ||
df_units[field["name"]] = field["unit"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is needed? or why a TypeError is thrown.
In line 256 i see the same line, maybe check if conversion can be done should be moved upwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I moved the check upwards, in line with the other checks.
TypeError is thrown because string (foreign key) cannot be multiplied by float.
No description provided.