Skip to content

[Bug]: ImportError: cannot import name 'coupled_global' #30

@forsyth2

Description

@forsyth2

What happened?

I ran into this issue while testing #29:

ImportError: cannot import name 'coupled_global' from 'zppy_interfaces.global_time_series.coupled_global'

Interestingly, I hadn't run into it at all on E3SM-Project/zppy#722 & #26 despite extensive testing of global_time_series in those PRs.

Full details

# Try 1: Unified works #########################################
cd ~/ez/zppy
git status
# No uncommitted changes
git fetch upstream main
git checkout -b test-gts-import-error upstream/main
conda clean --all --y
conda env create -f conda/dev.yml -n zppy-test-gts-import-error
conda activate zppy-test-gts-import-error
pip install .

# Edit tests/integration/utils.py
# UNIQUE_ID = "test-gts-import-error-try1"
#         "global_time_series_environment_commands": "source /lcrc/soft/climate/e3sm-unified/load_latest_e3sm_unified_chrysalis.sh",

# Edit v3 cfg to be as simple as possible
# By setting `active = False` as much as possible

python tests/integration/utils.py
pip install . && zppy -c tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg
cd /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test-gts-import-error-try1/v3.LR.historical_0051/post/scripts && grep -v "OK" *status
# No errors

# Try 2: custom dev env fails #########################################
cd ~/ez/zppy-interfaces
git status
# No uncommitted changes
git fetch upstream main
git checkout -b test-gts-import-error upstream/main
conda clean --all --y
conda env create -f conda/dev.yml -n zi-test-gts-import-error
conda activate zi-test-gts-import-error
pip install .

cd ~/ez/zppy
conda activate zppy-test-gts-import-error
# Edit tests/integration/utils.py
# UNIQUE_ID = "test-gts-import-error-try2"
#         "global_time_series_environment_commands": "source /gpfs/fs1/home/ac.forsyth2/miniforge3/etc/profile.d/conda.sh; conda activate zi-test-gts-import-error",
python tests/integration/utils.py
zppy -c tests/integration/generated/test_weekly_comprehensive_v3_chrysalis.cfg
cd /lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test-gts-import-error-try2/v3.LR.historical_0051/post/scripts && grep -v "OK" *status
cat global_time_series_1985-1995.o786875

That gives:

Traceback (most recent call last):
  File "/gpfs/fs1/home/ac.forsyth2/miniforge3/envs/zi-test-gts-import-error/bin/zi-global-time-series", line 5, in <module>
    from zppy_interfaces.global_time_series.__main__ import main
  File "/gpfs/fs1/home/ac.forsyth2/miniforge3/envs/zi-test-gts-import-error/lib/python3.12/site-packages/zppy_interfaces/global_time_series/__main__.py", line 6, in <module>
    from zppy_interfaces.global_time_series.coupled_global import coupled_global
ImportError: cannot import name 'coupled_global' from 'zppy_interfaces.global_time_series.coupled_global' (/gpfs/fs1/home/ac.forsyth2/miniforge3/envs/zi-test-gts-import-error/lib/python3.12/site-packages/zppy_interfaces/global_time_series/coupled_global/__init__.py)

===== COPY FILES TO WEB SERVER =====

rsync: link_stat "/lcrc/group/e3sm/ac.forsyth2/zppy_weekly_comprehensive_v3_output/test-gts-import-error-try2/v3.LR.historical_0051/post/scripts/global_time_series_1985-1995_results" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1189) [sender=3.1.3]

What machine were you running on?

Chrysalis

Environment

See above

What command did you run?

See above

What stack trace are you encountering?

See above

Metadata

Metadata

Assignees

No one assigned

    Labels

    semver: bugBug fix (will increment patch version)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions