Remove attribute-style accesses to (Geo)DataFrames columns and xarray Datasets variables and attributes by luseverin · Pull Request #939 · CLIMADA-project/climada_python
I did my best to replace all instances of attribute-style accesses with the recommended keyword-style accesses. Please let me know if you spot some instances that I missed!
What I still need to do is to update tests (as I assume this needs to be done as well).
| import os | ||
| import sys | ||
|
|
||
| class DataFrameAttributeVisitor(ast.NodeVisitor): |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the goal of this class?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it got mistakenly commited, I will remove it. It was a script to try to automatically find out occurences of attribute-style accesses but it was not working out well..
Great job!
I looked around with different regexps based on yours:
- There are some "exp.gdf.value" in util/lines_polys_handler.py (in docstrings mainly)
- entity/measure/base.py:492
- engine/unsequa/unc_output.py:1028
I did not find others (except for tests, but you said you still haven't done these yet)
Ok so I removed the few instances that I missed + the ones in the tests. Everything should be covered now. However I now have some tests failing with some weird errors e.g. AttributeError: module 'importlib_metadata' has no attribute 'entry_points' . I am not sure how this relates to my changes. When I did the make unit_test and make integ_test everything was passing.. Any idea where this might come from?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good job! You can merge as soon as we understand why the test are failing on Jenkins.
@emanuel-schmid any idea?
awesome! many thanks!
(the importlib_metadata error was most likely just about some incompatible conda package)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters