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

[Bug]: AttributeError: 'int' object has no attribute 'units' #870

Open
chengzhuzhang opened this issue Oct 18, 2024 · 0 comments
Open

[Bug]: AttributeError: 'int' object has no attribute 'units' #870

chengzhuzhang opened this issue Oct 18, 2024 · 0 comments
Assignees
Labels
bug Bug fix (will increment patch version)

Comments

@chengzhuzhang
Copy link
Contributor

chengzhuzhang commented Oct 18, 2024

What happened?

When testing zppy, @forsyth2 reported an error from derived variable.
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/derivations/acme.py", line 175, in molec_convert_units
if var.units == "molec/cm2/s":
AttributeError: 'int' object has no attribute 'units'

What did you expect to happen? Are there are possible answers you came across?

No response

Minimal Complete Verifiable Example (MVCE)

No response

Relevant log output

Example error from /lcrc/group/e3sm/ac.forsyth2/issue_622v5/v3.LR.historical_0051/post/scripts/e3sm_diags_atm_monthly_180x360_aave_mvm_v3alpha04i-COARE_vs_CTL_1985-2014_vs_0001-0050.o607385:

2024-10-16 15:19:15,254 [ERROR]: core_parameter.py(_run_diag:269) >> Error in e3sm_diags.driver.aerosol_budget_driver
Traceback (most recent call last):
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/parameter/core_parameter.py", line 266, in _run_diag
single_result = module.run_diag(self)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/driver/aerosol_budget_driver.py", line 148, in run_diag
metrics_dict_test[aerosol] = generate_metrics_dic(
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/driver/aerosol_budget_driver.py", line 82, in generate_metrics_d
ic
elvemis = data.get_climo_variable(f"{aerosol}_CLXF", season)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/driver/utils/dataset.py", line 161, in get_climo_variable
variables = self._get_climo_var(filename, *args, **kwargs)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/driver/utils/dataset.py", line 386, in _get_climo_var
derived_var = func(*variables)
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/derivations/acme.py", line 1654, in
(("bc_a?_CLXF",), lambda *x: molec_convert_units(sum(x), 12.0)),
File "/lcrc/soft/climate/e3sm-unified/base/envs/e3sm_unified_1.10.0_chrysalis/lib/python3.10/site-packages/e3sm_diags/derivations/acme.py", line 175, in molec_convert_units
if var.units == "molec/cm2/s":
AttributeError: 'int' object has no attribute 'units'

Anything else we need to know?

No response

Environment

e3sm_unified_1.10.0

@chengzhuzhang chengzhuzhang added the bug Bug fix (will increment patch version) label Oct 18, 2024
@chengzhuzhang chengzhuzhang self-assigned this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix (will increment patch version)
Projects
None yet
Development

No branches or pull requests

1 participant