PeterRochford / SkillMetrics

A Python library for calculating and displaying the skill of model predictions against observations.
GNU General Public License v3.0
195 stars 91 forks source link

Includes script for testing Taylor plots #30

Closed adlzanchetta closed 2 years ago

adlzanchetta commented 2 years ago

Developers could be motivated to check the output of running $ python Test/test_plots.py -clean_files if they touched codes related to the Taylor diagrams before git-committing.

PeterRochford commented 2 years ago

I tried running test_plots.py after the merge and got the following error.

Executing 14 scripts in sequence: taylor1.png Traceback (most recent call last): File "/Users/Peter/git/SkillMetrics/Test/test_plots.py", line 221, in evaluate_output(test_script_file_names, args.clean_files) File "/Users/Peter/git/SkillMetrics/Test/test_plots.py", line 178, in evaluate_output rasters_distance_pct, resized = compare_rasters_pixelwise( File "/Users/Peter/git/SkillMetrics/Test/test_plots.py", line 133, in compare_rasters_pixelwise pixels_prev, pixels_curr, resized = get_comparable_pixels_rgba(prev, curr) File "/Users/Peter/git/SkillMetrics/Test/test_plots.py", line 96, in get_comparable_pixels_rgba pixels_prev, pixels_curr = img_prev.array(), img_curr.array() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/PIL/Image.py", line 517, in getattr raise AttributeError(name) AttributeError: array

Any thoughts as to what might be causing it?

adlzanchetta commented 2 years ago

Strange. Seems something with the Pillow library.

Could you please let me know:

I will try to reproduce it tonight.

PeterRochford commented 2 years ago

Here is the information you requested.

iMac% pip show pillow Name: Pillow Version: 9.2.0 Summary: Python Imaging Library (Fork) Home-page: https://python-pillow.org Author: Alex Clark (PIL Fork Author) Author-email: aclark@python-pillow.org License: HPND Location: /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages Requires: Required-by: matplotlib

My OS is macOS Monterey Version 12.5.1.

Thanks in advance for looking into the problem.

PeterRochford commented 2 years ago

I updated all of the example scripts to include the optional arguments -noshow and -nosave. you may wish to do a git pull before investigating the above problem.

Note that the Wiki pages have also been updated to mention these useful options.

adlzanchetta commented 2 years ago

Indeed when I developed the test script I was using a virtual environment with Python 3.6 and pillow 8.4. Sending pull request #31 with corrections for supporting Python 3.10 and pillow 9.2 as well. I would appreciate if you can double check if it also run in your machine.