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

cia broken ? #41

Open
doutriaux1 opened this issue Aug 30, 2018 · 6 comments
Open

cia broken ? #41

doutriaux1 opened this issue Aug 30, 2018 · 6 comments

Comments

@doutriaux1
Copy link
Contributor

test_cdp.py

import cdp

parser = cdp.cdp_parser.CDPParser(None, "params.json")

parser.use("parameters")
parser.use("diags")
parser.use("mip")


args = parser.get_parameter()

print("ARGS MIP:",args.mip)

params.jon

{
    "--diags":{
        "aliases":[
            "-d"
        ],
        "dest":"other_parameters",
        "help":"Path to other user-defined parameter file.",
        "nargs":"+",
        "required":false,
        "type":"str"
    },
    "--mip":{
        "aliases":[
            "--MIP"
        ],
        "default":"None",
        "dest":"MIP",
        "help":"A WCRP MIP project such as CMIP3 and CMIP5"
    },
    "--parameters":{
        "aliases":[
            "-p"
        ]
    }
}

params.py

mip = "MIPS_ARGUMENT"
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16242]> conda list cdp
# packages in environment at /home/doutriaux1/anaconda2/envs/py3:
#
# Name                    Version                   Build  Channel
cdp                       1.3.3.2018.08.28.22.21          py36_0    cdat/label/nightly
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16239]> python test_cdp.py -p params.py 
ARGS MIP: MIPS_ARGUMENT
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16239]> python test_cdp.py --mip=5
Traceback (most recent call last):
  File "test_cdp.py", line 12, in <module>
    print("ARGS MIP:",args.mip)
AttributeError: 'CDPParameter' object has no attribute 'mip'
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16240]> conda update cdp -c cdat/label/nightly
Solving environment: |- 
done

## Package Plan ##

  environment location: /home/doutriaux1/anaconda2/envs/py3

  added / updated specs: 
    - cdp


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    certifi-2018.8.24          |           py36_1         140 KB
    cdp-1.3.3.2018.08.29.00.38 |           py36_0          24 KB  cdat/label/nightly
    ------------------------------------------------------------
                                           Total:         164 KB

The following packages will be UPDATED:

    cdp:     1.3.3.2018.08.28.22.21-py36_0 cdat/label/nightly --> 1.3.3.2018.08.29.00.38-py36_0 cdat/label/nightly
    certifi: 2018.8.24-py36_1              conda-forge        --> 2018.8.24-py36_1                                
    openssl: 1.0.2o-h470a237_1             conda-forge        --> 1.0.2p-h14c3975_0                               

Proceed ([y]/n)? 

Downloading and Extracting Packages
certifi-2018.8.24    |  140 KB | ######################################################################################################################################################################################################################################## | 100% 
cdp-1.3.3.2018.08.29 |   24 KB | ######################################################################################################################################################################################################################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16241]> python test_cdp.py --mip=5
Traceback (most recent call last):
  File "test_cdp.py", line 12, in <module>
    print("ARGS MIP:",args.mip)
AttributeError: 'CDPParameter' object has no attribute 'mip'
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16241]> python test_cdp.py -p params.py 
Traceback (most recent call last):
  File "test_cdp.py", line 10, in <module>
    args = parser.get_parameter()
  File "/home/doutriaux1/anaconda2/envs/py3/lib/python3.6/site-packages/cdp/cdp_parser.py", line 462, in get_parameter
    return self.get_parameters(*args, **kwargs)[0]
  File "/home/doutriaux1/anaconda2/envs/py3/lib/python3.6/site-packages/cdp/cdp_parser.py", line 428, in get_parameters
    orig_parameters = self.get_orig_parameters(*args, **kwargs)
  File "/home/doutriaux1/anaconda2/envs/py3/lib/python3.6/site-packages/cdp/cdp_parser.py", line 115, in get_orig_parameters
    self._usable_via_cmdline_args(parameter)
  File "/home/doutriaux1/anaconda2/envs/py3/lib/python3.6/site-packages/cdp/cdp_parser.py", line 281, in _usable_via_cmdline_args
    raise RuntimeError(msg)
RuntimeError: mip is not a valid parameter because it's not defined in the parser.
(py3) doutriaux1@drdoom:[pcmdi_metrics]:[new_Cdp_defaults]:[16241]> 
@doutriaux1
Copy link
Contributor Author

can't have default upper case if param is lower case. Fixed by https://github.com/PCMDI/CIA/releases/tag/0.0.6

@doutriaux1
Copy link
Contributor Author

@lee1043 update cia you will be good to go

@lee1043
Copy link

lee1043 commented Aug 30, 2018

@doutriaux1 thanks for solving this issue. I am in motion of updating cia via conda but it may take time to show up there? I still see 0.0.5 version when conda install -f cia -c cdat/label/nightly

@lee1043
Copy link

lee1043 commented Aug 30, 2018

updated by conda update cia -c pcmdi, thanks @doutriaux1

@lee1043 lee1043 reopened this Aug 30, 2018
@lee1043
Copy link

lee1043 commented Aug 30, 2018

(pmp_nightly_20180830) -bash-4.1$ conda list cia
# packages in environment at /export_backup/lee1043/anaconda2/envs/pmp_nightly_20180830:
#
# Name                    Version                   Build  Channel
cia                       0.0.6                         0    pcmdi
(pmp_nightly_20180830) -bash-4.1$ conda list cdp
# packages in environment at /export_backup/lee1043/anaconda2/envs/pmp_nightly_20180830:
#
# Name                    Version                   Build  Channel
cdp                       1.3.3.2018.08.30.21.17          py27_0    cdat/label/nightly
(pmp_nightly_20180830) -bash-4.1$ p test_cdp.py -p params.py
Traceback (most recent call last):
  File "test_cdp.py", line 10, in <module>
    args = parser.get_parameter()
  File "/export_backup/lee1043/anaconda2/envs/pmp_nightly_20180830/lib/python2.7/site-packages/cdp/cdp_parser.py", line 462, in get_parameter
    return self.get_parameters(*args, **kwargs)[0]
  File "/export_backup/lee1043/anaconda2/envs/pmp_nightly_20180830/lib/python2.7/site-packages/cdp/cdp_parser.py", line 428, in get_parameters
    orig_parameters = self.get_orig_parameters(*args, **kwargs)
  File "/export_backup/lee1043/anaconda2/envs/pmp_nightly_20180830/lib/python2.7/site-packages/cdp/cdp_parser.py", line 115, in get_orig_parameters
    self._usable_via_cmdline_args(parameter)
  File "/export_backup/lee1043/anaconda2/envs/pmp_nightly_20180830/lib/python2.7/site-packages/cdp/cdp_parser.py", line 281, in _usable_via_cmdline_args
    raise RuntimeError(msg)
RuntimeError: mip is not a valid parameter because it's not defined in the parser.

Do I still need to downgrade cdp by conda install -f "cdp<1.3.3.2018.08.29" -c cdat/label/nightly? Confirmed it is working after I downgrade.

@doutriaux1
Copy link
Contributor Author

oh no... Let me try again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants