oceanmodeling / ondemand-storm-workflow

Other
2 stars 1 forks source link

AttributeError due to GeoPandas version #54

Closed FariborzDaneshvar-NOAA closed 2 months ago

FariborzDaneshvar-NOAA commented 2 months ago

@SorooshMani-NOAA the post-processing step failed with this error:

[2024-07-02 04:22:17,063] klpc_wetonly    INFO    : dividing 70/30% for training/testing the model                     
Traceback (most recent call last):                                                                                       
  File "/nhc/Fariborz.Daneshvar/miniconda3/envs/stormworkflow/bin/analyze_ensemble", line 8, in <module>                   
    sys.exit(cli())                                                                                                      
  File "/nhc/Fariborz.Daneshvar/sandbox/workflow_native/ondemand-storm-workflow/stormworkflow/post/analyze_ensemble.py", line 408, in cli                                                                                                         
    main(parser.parse_args())                                                                                            
  File "/nhc/Fariborz.Daneshvar/sandbox/workflow_native/ondemand-storm-workflow/stormworkflow/post/analyze_ensemble.py", line 49, in main                                                                                                         
    analyze(tracks_dir, ensemble_dir / 'analyze')                                                                        
  File "/nhc/Fariborz.Daneshvar/sandbox/workflow_native/ondemand-storm-workflow/stormworkflow/post/analyze_ensemble.py", line 56, in analyze                                                                                                      
    _analyze(tracks_dir, analyze_dir, mann_coef)                                                                         
  File "/nhc/Fariborz.Daneshvar/sandbox/workflow_native/ondemand-storm-workflow/stormworkflow/post/analyze_ensemble.py", line 173, in _analyze                                                                                                    
    plot_perturbations(                                                                                                  
  File "/nhc/Fariborz.Daneshvar/miniconda3/envs/stormworkflow/lib/python3.10/site-packages/ensembleperturbation/plotting/perturbation.py", line 178, in plot_perturbations      
    countries = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))                                  
  File "/nhc/Fariborz.Daneshvar/miniconda3/envs/stormworkflow/lib/python3.10/site-packages/geopandas/datasets/__init__.py", line 18, in get_path                                                                                                  
    raise AttributeError(error_msg)                                                                                    
AttributeError: The geopandas.dataset has been deprecated and was removed in GeoPandas 1.0. You can get the original
'naturalearth_lowres' data from https://www.naturalearthdata.com/downloads/110m-cultural-vectors/. 

Should I change GeoPandas version?

SorooshMani-NOAA commented 2 months ago

Sorry I forgot about this ... when I was testing 1.0 was not released! For now please use geopandas 0.14, but I'll have to address this in the script sometime soon!

SorooshMani-NOAA commented 2 months ago

Actually @FariborzDaneshvar-NOAA this is addressed in the hurricane_data script. We can do the same thing for post and ensemble perturbation. So I'll create an issue there and close this. For now let's add the limit for geopandas in your PR and then please add a comment in the file saying that ensembleperturbation is the reason.

SorooshMani-NOAA commented 2 months ago

https://github.com/noaa-ocs-modeling/EnsemblePerturbation/issues/143

FariborzDaneshvar-NOAA commented 2 months ago

Thanks! Geopandas has been commented in pyproject.toml and I'm installing it manually later. For now, I changed it on my environment (pip install "geopandas==0.14"). Should I change the commented line in pyproject.toml?

SorooshMani-NOAA commented 2 months ago

Let's do ==0.14 in pyproject.toml (and also probably environment?). And when we install we need to first install adcircpy and then stormworkflow. It's not that important at this point. We know what works, we need to address it in ensembleperturbation and adcircpy to resolve the actual conflicts!