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

Remove attribute-style accesses to (Geo)DataFrames columns and xarray Datasets variables and attributes within tutorials #941

Merged
merged 8 commits into from
Aug 30, 2024

Conversation

spjuhel
Copy link
Collaborator

@spjuhel spjuhel commented Aug 21, 2024

See also #939 for the codebase counterpart.

Changes proposed in this PR:

  • Removal of attribute style-accesses to columns of pandas DataFrames, GeoDataFrames, and variables and attributes of xarray DataSets and DataArray within the documentation

This PR fixes SCRUM userstory 100: Avoid attribute-style access to DataFrame columns (https://tree.taiga.io/project/emanuel-schmid-climada/us/100).

PR Author Checklist

PR Reviewer Checklist

@spjuhel spjuhel requested a review from luseverin August 21, 2024 09:51
@spjuhel spjuhel added the conventions Coding conventions or style label Aug 21, 2024
Copy link
Collaborator

@luseverin luseverin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Unfortunately I cannot open none of the modified tutorial files, as the notebooks seem to be broken (see the following error message, here for util_calibrate):
Expected ',' or ']' after array element in JSON at position 133145 (line 1692 column 57)
Apparently you removed one ',' or ']' when you modified the notebooks? You might want to check that out.

@spjuhel
Copy link
Collaborator Author

spjuhel commented Aug 23, 2024

Woups, problems with the types of quotes used. Should be fixed now, sorry about that.

Copy link
Collaborator

@luseverin luseverin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at your changes, it looks good now. There is still one typo to be fixed though.

Otherwise, I think I spotted a couple missed instances of attribute-style accesses:
In climada_hazard_TropCyclone.ipynb:
1753: "print('Daily max sustained wind:', tc_syn.max_sustained_wind.groupby('time.day').max())"
and in climada_util_calibrate.ipynb:
1042: "emdat_subset = emdat[(emdat.cal_region2 == \"NA1\") & (emdat.year >= 2010)]\n",

This aside, it looks all good, well done!

doc/tutorial/climada_engine_Impact.ipynb Show resolved Hide resolved
@spjuhel spjuhel merged commit 36f4735 into develop Aug 30, 2024
18 checks passed
@spjuhel spjuhel deleted the feature/remove-attribute-style-access-tutorials branch August 30, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conventions Coding conventions or style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants