-
Notifications
You must be signed in to change notification settings - Fork 6
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
[FEAT] Added function to create nice labels and units #161
Conversation
I have tried the possible new doc string format with
We can see if we like it and if so I will change all the other functions |
glidertest/utilities.py
Outdated
if var in label_dict: | ||
units = f'{label_dict[var]["units"]}' | ||
else: | ||
units= f'{ds[var].units}' |
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.
recommend a further catch for variables without units
if var in label_dict:
return f'{label_dict[var]["units"]}'
elif 'units' in ds[var].attrs:
return f'{ds[var].attrs['units']}'
else:
return ""
var : The name of the variable to plot. Default is 'DOXY'. | ||
|
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.
As a general guidance, try not to add these stylistic fixes to unrelated code in a PR, it makes the review process more confusing! You can do a seperate PR that just fixes typos and style etc. Or, if you're feeling extra cool, you can check out python linters like astral
We can leave them in for this PR though :)
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.
Ok I did remove it haha
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
sorry I broke ur tests 😢 |
I have not added all possible variables to the dictionary (and I am not sure I am doing this the right way either).
I have not modified the labels for eleanors functions either