uaf-arctic-eco-modeling / dvm-dos-tem

A process based Dynamic Vegetation, Dynamic Organic Soil, Terrestrial Ecosystem Model.
MIT License
22 stars 24 forks source link

Sensitivity, fails to plot distributions if there is only a single parameter (and single PFT) specified for the run. #694

Closed tobeycarman closed 6 months ago

tobeycarman commented 6 months ago
develop@e6d51e72b999:/work/mads_calibration$ ./SA_setup_and_run.py /data/workflows/CMT52/working_config/only/sa-cmax.yaml --force
The filename you provided is: /data/workflows/CMT52/working_config/only/sa-cmax.yaml
Traceback (most recent call last):
  File "./SA_setup_and_run.py", line 86, in <module>
    driver.setup_multi() 
  File "/work/scripts/drivers/Sensitivity.py", line 935, in setup_multi
    self.plot_sensitivity_matrix(save=True)
  File "/work/scripts/drivers/Sensitivity.py", line 1468, in plot_sensitivity_matrix
    ax[0].plot(self.sample_matrix.iloc[:, i], marker='.', linewidth=0, alpha=.5)
TypeError: 'AxesSubplot' object is not subscriptable

I think the solution is to add squeeze=False to the plt.subplots(...) so that it is forced to return a 2D array of subplots.

tobeycarman commented 6 months ago

Fixed by PR #697