noaa-ocs-modeling / CoupledModelDriver

coupled model configuration generation
https://CoupledModelDriver.readthedocs.io
Creative Commons Zero v1.0 Universal
4 stars 3 forks source link

`check_completion` command didn't work #170

Open FariborzDaneshvar-NOAA opened 3 weeks ago

FariborzDaneshvar-NOAA commented 3 weeks ago

I have a conda environment with these packages:

coupledmodeldriver   1.7.1.post1   
ensembleperturbation 1.3.1 
stormevents          2.2.5

The check_completion command failed with this error:

[2024-08-21 08:49:18,512] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module
/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/pyschism/forcing/hycom/gofs.py:8: 
UserWarning: The seawater library is deprecated! Please use gsw instead.                                             
  import seawater as sw                                                                                                
[2024-08-21 08:49:21,648] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                                                   
[2024-08-21 08:49:21,651] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                                                   
[2024-08-21 08:49:21,654] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                                                   
Traceback (most recent call last):                                                                                       
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/bin/check_completion", line 8, in <module>
       sys.exit(main())                                                                                                                
                    ^^^^^^                                                                                                      
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/client/check_completion.py", line 206, in main
       completion_status = check_completion(**parse_check_completion_arguments())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/client/check_completion.py", line 126, in check_completion
       for model_type in Model.values():                                                                                                        
                         ^^^^^^^^^^^^^^                                                                                       
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/enum.py", line 784, in __getattr__      
       raise AttributeError(name) from None                                                                               
AttributeError: values  
SorooshMani-NOAA commented 3 weeks ago

The issues seems to be in: https://github.com/noaa-ocs-modeling/CoupledModelDriver/blob/ba4c6a9cb62d279e239edce946becb79dcb029d2/coupledmodeldriver/client/check_completion.py#L126-L128

Where we should have had something like:

-     for model_type in Model.values():
-         if not is_model_directory(directory, model=model_type): 
+     for model_type in Model:
+         if not is_model_directory(directory, model=model_type.value): 
              continue 

@FariborzDaneshvar-NOAA can you please try installing coupledmodeldriver locally and try this and see if it resolves the issue or not?

FariborzDaneshvar-NOAA commented 3 weeks ago

@SorooshMani-NOAA I made these changes locally and re-installed it.

image

But now I'm getting a new error:

[2024-08-21 09:43:28,049] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                           
/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/pyschism/forcing/hycom/gofs.py:8: UserWarning: The seawater library is deprecated! Please use gsw instead. 
    import seawater as sw                                                                                    
[2024-08-21 09:43:31,947] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                           
[2024-08-21 09:43:31,950] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                           
[2024-08-21 09:43:31,955] /work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/_depend.py WARNING : can't find the 'adcircpy' module                           
Traceback (most recent call last):                                                                           
File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/bin/check_completion", line 8, in <module>                                                                                                            
sys.exit(main())                                                                                                    
^^^^^^                                                                                          
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/client/check_completion.py", line 208, in main                                                        
      completion_status = check_completion(**parse_check_completion_arguments())                                                     
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                               
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/client/check_completion.py", line 127, in check_completion                                            
      if not is_model_directory(directory, model=model_type.value):                                                     
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                             
    File "/work2/noaa/nos-surge/daneshva/miniconda3/envs/stormwf_v002/lib/python3.11/site-packages/coupledmodeldriver/client/check_completion.py", line 72, in is_model_directory                                           
      raise NotImplementedError(f'model "{model}" not implemented')                                          
NotImplementedError: model "ADCIRC" not implemented   
SorooshMani-NOAA commented 3 weeks ago

Sorry I think we actually don't need .value for the is_model_directory argument. Can you try that as well please?

FariborzDaneshvar-NOAA commented 3 weeks ago

I think we actually don't need .value for the is_model_directory argument. Can you try that as well please?

Now I'm getting this error: image