AaronWard / covidify

Covidify - corona virus report and dataset generator for python πŸ“ˆ [no longer being updated]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)

enjrolas opened this issue Β· comments

I just installed covidify on my 2019 macbook air, python 3.7.6.
When I run 'covidify run', things go well until it tries to generate the line plots, and then throws the error:

ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)

I did some digging, and the issue is between matplotlib and pillow, specifically with versions of pillow >= 7.0. (see ipython/ipython#8052). Downgrading pillow to 6.x fixed it.

If it's happening to me, it'll happen to other folks. I think the easy fix is just to change the export to a .png format, which I believe has better support. That's my $.02

Full dump is below.

Alexs-Air-2:~ enjrolas$ covidify run
MESSAGE: No output directory given, defaulting to /Users/enjrolas/Desktop/covidify-output/
MESSAGE: No source given, defaulting to John Hopkin CSSE github repo

Job arguments:

ENV: /usr/local/lib/python3.7/site-packages/covidify
OUTPUT FOLDER: /Users/enjrolas/Desktop/covidify-output/
DATA SOURCE: git

Data Extraction

git pull from https://github.com/CSSEGISandData/COVID-19.git
Getting sheets...
... importing data: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 49/49 [00:02<00:00, 22.23it/s]
Sorting by datetime...
Calculating dataframe for new cases...
Creating subdirectory for data...
... /Users/enjrolas/Desktop/covidify-output/data/2020-03-09
Saving...
... agg_data_2020-03-09.parquet.gzip
... agg_data_2020-03-09.csv
... trend_2020-03-09.csv
Done!

Data Exploration

Importing Data...
Creating graphs...
... Time Series Trend Line
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/covidify/data_exploration.py", line 93, in
create_trend_line(agg_df, 'confirmed', 'deaths', 'recovered')
File "/usr/local/lib/python3.7/site-packages/covidify/data_exploration.py", line 68, in create_trend_line
fig.savefig(os.path.join(image_dir, '{}_trendline.jpg'.format(col)))
File "/usr/local/lib/python3.7/site-packages/matplotlib/figure.py", line 2180, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/usr/local/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2014, in print_figure
canvas = self._get_output_canvas(format)
File "/usr/local/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 1956, in _get_output_canvas
.format(fmt, ", ".join(sorted(self.get_supported_filetypes()))))
ValueError: Format 'jpg' is not supported (supported formats: eps, pdf, pgf, png, ps, raw, rgba, svg, svgz)

Complete!

commented

@enjrolas nice spot, ill change everything to png format πŸ‘πŸΌ

commented

@enjrolas issue resolved in newest release