-
Notifications
You must be signed in to change notification settings - Fork 48
Add CDP to PMP utils #1340
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
Add CDP to PMP utils #1340
Conversation
|
@lee1043 it looks like this PR is failing 2 tests - could you help me figure out what the issue is? Thanks! |
|
Hi @kristinchang3, thanks for the PR. I see the following messages from the failing tests. Can you try tackling them? I think one of them is circular import error. ==================================== ERRORS ====================================
______________________ ERROR collecting tests/test_qc.py _______________________
ImportError while importing test module '/home/runner/work/pcmdi_metrics/pcmdi_metrics/tests/test_qc.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../miniconda3/envs/pcmdi_metrics_ci/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_qc.py:5: in <module>
from pcmdi_metrics.utils import (
pcmdi_metrics/utils/__init__.py:26: in <module>
from .pmp_parameter import PMPMetricsParameter, PMPParameter
pcmdi_metrics/utils/pmp_parameter.py:6: in <module>
from pcmdi_metrics.utils import StringConstructor
E ImportError: cannot import name 'StringConstructor' from partially initialized module 'pcmdi_metrics.utils' (most likely due to a circular import) (/home/runner/work/pcmdi_metrics/pcmdi_metrics/pcmdi_metrics/utils/__init__.py)
____________________ ERROR collecting tests/test_sea_ice.py ____________________
ImportError while importing test module '/home/runner/work/pcmdi_metrics/pcmdi_metrics/tests/test_sea_ice.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../miniconda3/envs/pcmdi_metrics_ci/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_sea_ice.py:4: in <module>
from pcmdi_metrics.sea_ice.lib import sea_ice_lib as lib
pcmdi_metrics/sea_ice/lib/__init__.py:1: in <module>
from .sea_ice_parser import create_sea_ice_parser
pcmdi_metrics/sea_ice/lib/sea_ice_parser.py:2: in <module>
from pcmdi_metrics.utils import pmp_parser
pcmdi_metrics/utils/__init__.py:26: in <module>
from .pmp_parameter import PMPMetricsParameter, PMPParameter
pcmdi_metrics/utils/pmp_parameter.py:6: in <module>
from pcmdi_metrics.utils import StringConstructor
E ImportError: cannot import name 'StringConstructor' from partially initialized module 'pcmdi_metrics.utils' (most likely due to a circular import) (/home/runner/work/pcmdi_metrics/pcmdi_metrics/pcmdi_metrics/utils/__init__.py)
=============================== warnings summary ===============================
../../../miniconda3/envs/pcmdi_metrics_ci/lib/python3.10/site-packages/pyogrio/__init__.py:7
/home/runner/miniconda3/envs/pcmdi_metrics_ci/lib/python3.10/site-packages/pyogrio/__init__.py:7: DeprecationWarning: The 'shapely.geos' module is deprecated, and will be removed in a future version. All attributes of 'shapely.geos' are available directly from the top-level 'shapely' namespace (since shapely 2.0.0).
import shapely.geos # noqa: F401 |
|
@lee1043 just fixed! |
lee1043
left a comment
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.
@kristinchang3 great job, the changes are looking good to me!
Hi @lee1043 - I added the following CDP scripts to PMP Utils and PMP io:
utils:
io:
These scripts are not dependent on the esgf_output_viewer package that is no longer maintained and have been tested with higher versions of python (3.11-3.13).
I also moved the following existing PMP scripts from ./mean_climate/lib to utils:
Metrics' driver scripts have been updated accordingly to reference the local versions of these script updates. Additionally the cdp library import has been removed from both conda environments.
Please test by running Demo notebooks 0, 1a, 1b, 2a, 2b, 3, 4, 5, 7, 7b, and 8. Thanks!