Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

More consistency for codes style and format #877

Merged
merged 2 commits into from
Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 24 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -3,24 +3,29 @@ default_stages: [commit]
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: check-yaml

- repo: https://github.com/timothycrosley/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black

# Need to use flake8 GitHub mirror due to CentOS git issue with GitLab
# https://github.com/pre-commit/pre-commit/issues/1206
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
args: ["--config=setup.cfg"]
additional_dependencies: [flake8-isort]
- repo: https://github.com/timothycrosley/isort
rev: 5.10.1
hooks:
- id: isort

# Need to use flake8 GitHub mirror due to CentOS git issue with GitLab
# https://github.com/pre-commit/pre-commit/issues/1206
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args: ["--config=setup.cfg"]
additional_dependencies: [flake8-isort]
28 changes: 2 additions & 26 deletions doc/jupyter/Demo/Demo_0_download_data.ipynb
Original file line number Diff line number Diff line change
@@ -62,31 +62,6 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading: 'CMIP5_demo_clims/cmip5.historical.ACCESS1-0.r1i1p1.mon.pr.198101-200512.AC.v20200426.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip5.historical.ACCESS1-0.r1i1p1.mon.pr.198101-200512.AC.v20200426.nc\n",
"Downloading: 'CMIP5_demo_clims/cmip5.historical.ACCESS1-0.r1i1p1.mon.rlut.198101-200512.AC.v20200426.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip5.historical.ACCESS1-0.r1i1p1.mon.rlut.198101-200512.AC.v20200426.nc\n",
"Downloading: 'CMIP5_demo_clims/cmip5.historical.ACCESS1-0.r1i1p1.mon.zg.198101-200512.AC.v20200426.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip5.historical.ACCESS1-0.r1i1p1.mon.zg.198101-200512.AC.v20200426.nc\n",
"Downloading: 'CMIP5_demo_clims/cmip5.historical.CanCM4.r1i1p1.mon.pr.198101-200512.AC.v20200426.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip5.historical.CanCM4.r1i1p1.mon.pr.198101-200512.AC.v20200426.nc\n",
"Downloading: 'CMIP5_demo_clims/cmip5.historical.CanCM4.r1i1p1.mon.rlut.198101-200512.AC.v20200426.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip5.historical.CanCM4.r1i1p1.mon.rlut.198101-200512.AC.v20200426.nc\n",
"Downloading: 'CMIP5_demo_clims/cmip5.historical.CanCM4.r1i1p1.mon.zg.198101-200512.AC.v20200426.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip5.historical.CanCM4.r1i1p1.mon.zg.198101-200512.AC.v20200426.nc\n",
"Downloading: 'CMIP5_demo_clims/cmip6.historical.MCM-UA-1-0.r1i1p1f1.mon.zg.198101-200512.AC.v20201119.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_clims/cmip6.historical.MCM-UA-1-0.r1i1p1f1.mon.zg.198101-200512.AC.v20201119.nc\n",
"Downloading: 'CMIP5_demo_data/psl_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_data/psl_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc\n",
"Downloading: 'CMIP5_demo_data/sftlf_fx_ACCESS1-0_amip_r0i0p0.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_data/sftlf_fx_ACCESS1-0_amip_r0i0p0.nc\n",
"Downloading: 'CMIP5_demo_data/cmip5.amip.ACCESS1-0.sftlf.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_data/cmip5.amip.ACCESS1-0.sftlf.nc\n",
"Downloading: 'CMIP5_demo_data/cmip5.historical.GISS-E2-H.sftlf.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_data/cmip5.historical.GISS-E2-H.sftlf.nc\n",
"Downloading: 'CMIP5_demo_data/ts_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_data/ts_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc\n",
"Downloading: 'CMIP5_demo_timeseries/historical/atmos/day/pr/pr_day_GISS-E2-H_historical_r6i1p1_20000101-20051231.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/CMIP5_demo_timeseries/historical/atmos/day/pr/pr_day_GISS-E2-H_historical_r6i1p1_20000101-20051231.nc\n",
"Downloading: 'obs4MIPs_PCMDI_clims/rlut/CERES-EBAF-4-0/v20210804/rlut_mon_CERES-EBAF-4-0_PCMDI_gn.200301-201812.AC.v20210804.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_clims/rlut/CERES-EBAF-4-0/v20210804/rlut_mon_CERES-EBAF-4-0_PCMDI_gn.200301-201812.AC.v20210804.nc\n",
"Downloading: 'obs4MIPs_PCMDI_clims/rlut/CERES-EBAF-4-1/v20210804/rlut_mon_CERES-EBAF-4-1_PCMDI_gn.200301-201812.AC.v20210804.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_clims/rlut/CERES-EBAF-4-1/v20210804/rlut_mon_CERES-EBAF-4-1_PCMDI_gn.200301-201812.AC.v20210804.nc\n",
"Downloading: 'obs4MIPs_PCMDI_clims/pr/GPCP-2-3/v20210804/pr_mon_GPCP-2-3_PCMDI_gn.200301-201812.AC.v20210804.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_clims/pr/GPCP-2-3/v20210804/pr_mon_GPCP-2-3_PCMDI_gn.200301-201812.AC.v20210804.nc\n",
"Downloading: 'obs4MIPs_PCMDI_clims/zg/ERA-INT/v20210804/zg_mon_ERA-INT_PCMDI_gn.200301-201812.AC.v20210804.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_clims/zg/ERA-INT/v20210804/zg_mon_ERA-INT_PCMDI_gn.200301-201812.AC.v20210804.nc\n",
"Downloading: 'obs4MIPs_PCMDI_monthly/ECMWF/ERA-INT/mon/zg/gn/v20210727/zg_mon_ERA-INT_PCMDI_gn_198901-201001.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_monthly/ECMWF/ERA-INT/mon/zg/gn/v20210727/zg_mon_ERA-INT_PCMDI_gn_198901-201001.nc\n",
"Downloading: 'obs4MIPs_PCMDI_monthly/NASA-LaRC/CERES-EBAF-4-1/mon/rlut/gn/v20210727/rlut_mon_CERES-EBAF-4-1_PCMDI_gn_200301-201812.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_monthly/NASA-LaRC/CERES-EBAF-4-1/mon/rlut/gn/v20210727/rlut_mon_CERES-EBAF-4-1_PCMDI_gn_200301-201812.nc\n",
"Downloading: 'obs4MIPs_PCMDI_monthly/NOAA-NCEI/GPCP-2-3/mon/pr/gn/v20210727/pr_mon_GPCP-2-3_PCMDI_gn_197901-201907.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_monthly/NOAA-NCEI/GPCP-2-3/mon/pr/gn/v20210727/pr_mon_GPCP-2-3_PCMDI_gn_197901-201907.nc\n",
"Downloading: 'obs4MIPs_PCMDI_monthly/NOAA-ESRL-PSD/20CR/mon/psl/gn/v20210727/psl_mon_20CR_PCMDI_gn_187101-201212.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_monthly/NOAA-ESRL-PSD/20CR/mon/psl/gn/v20210727/psl_mon_20CR_PCMDI_gn_187101-201212.nc\n",
"Downloading: 'obs4MIPs_PCMDI_monthly/MOHC/HadISST-1-1/mon/ts/gn/v20210727/ts_mon_HadISST-1-1_PCMDI_gn_187001-201907.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_monthly/MOHC/HadISST-1-1/mon/ts/gn/v20210727/ts_mon_HadISST-1-1_PCMDI_gn_187001-201907.nc\n",
"Downloading: 'obs4MIPs_PCMDI_daily/NASA-JPL/GPCP-1-3/day/pr/gn/latest/pr_day_GPCP-1-3_PCMDI_gn_19961002-20170101.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/obs4MIPs_PCMDI_daily/NASA-JPL/GPCP-1-3/day/pr/gn/latest/pr_day_GPCP-1-3_PCMDI_gn_19961002-20170101.nc\n",
"Downloading: 'misc_demo_data/atm/3hr/pr/pr_3hr_IPSL-CM5A-LR_historical_r1i1p1_5x5_1997-1999.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/misc_demo_data/atm/3hr/pr/pr_3hr_IPSL-CM5A-LR_historical_r1i1p1_5x5_1997-1999.nc\n",
"Downloading: 'misc_demo_data/fx/sftlf.GPCP-IP.1x1.nc' from 'https://pcmdiweb.llnl.gov/pss/pmpdata/' in: demo_data/misc_demo_data/fx/sftlf.GPCP-IP.1x1.nc\n",
"All files downloaded\n"
]
}
@@ -118,6 +93,7 @@
"output_type": "stream",
"text": [
"Preparing parameter file: basic_mjo_param.py\n",
"Preparing parameter file: basic_mov_param_sst.py\n",
"Preparing parameter file: basic_diurnal_composite.py\n",
"Preparing parameter file: basic_param.py\n",
"Preparing parameter file: basic_diurnal_compute_daily_mean.py\n",
@@ -165,7 +141,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.9.7"
},
"selected_variables": [],
"vcdat_file_path": "",
9 changes: 5 additions & 4 deletions doc/jupyter/Demo/Demo_7_precip_variability.ipynb
Original file line number Diff line number Diff line change
@@ -138,7 +138,8 @@
"noverlap = 1 * 365\n",
"\n",
"# flag for cmec formatted JSON\n",
"cmec = False\n"
"cmec = False\n",
"\n"
]
}
],
@@ -304,9 +305,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"PS_pr.day_regrid.180x90_GISS-E2-H.historical.nc\r\n",
"PS_pr.day_regrid.180x90_GISS-E2-H.historical_unforced.nc\r\n",
"PS_pr.day_regrid.180x90_area.freq.mean_GISS-E2-H.historical.json\r\n"
"PS_pr.day_regrid.180x90_GISS-E2-H.historical.nc\n",
"PS_pr.day_regrid.180x90_GISS-E2-H.historical_unforced.nc\n",
"PS_pr.day_regrid.180x90_area.freq.mean_GISS-E2-H.historical.json\n"
]
}
],
23 changes: 14 additions & 9 deletions doc/jupyter/Demo/data_files.txt
Original file line number Diff line number Diff line change
@@ -8,14 +8,19 @@ https://pcmdiweb.llnl.gov/pss/pmpdata/
1abfd5cbcceac61ac51fed2e2c398eed CMIP5_demo_clims/cmip6.historical.MCM-UA-1-0.r1i1p1f1.mon.zg.198101-200512.AC.v20201119.nc
d5e86e3680cce1a0004bbe9663d20cf6 CMIP5_demo_data/psl_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc
dd810f1de8a5db5cddf6a0ab22717cdc CMIP5_demo_data/sftlf_fx_ACCESS1-0_amip_r0i0p0.nc
63ea73e990aa7f2f53de8b493eb3e051 CMIP5_demo_data/cmip5.amip.ACCESS1-0.sftlf.nc
aa2384a8957af8ee6e652fb6a27f1f4a CMIP5_demo_data/cmip5.historical.GISS-E2-H.sftlf.nc
2c402715c026eb1d39ec8e450857ef6e CMIP5_demo_data/ts_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc
804a9542e3681917c9da7ba3d62503fa PCMDIobs2_clims/atmos/rlut/CERES-EBAF-4-0/rlut_mon_CERES-EBAF-4-0_BE_gn_200003-201810.v20200421.AC.nc
0358a26ade74574eb44a4c37fb0c59e1 PCMDIobs2_clims/atmos/rlut/CERES-EBAF-4-1/rlut_mon_CERES-EBAF-4-1_BE_gn_200301-201812.v20200421.AC.nc
d773f68878d213db1c253417f7c7d380 PCMDIobs2_clims/atmos/pr/GPCP-2-3/pr_mon_GPCP-2-3_BE_gn_197901-201907.v20200421.AC.nc
1a75c3fc6ca9f6dc1867898dcc8343e8 PCMDIobs2_clims/atmos/zg/ERA-INT/zg_mon_ERA-INT_BE_gn_198901-201001.v20200421.AC.nc
8534afbd8ab49e7a48b64b1f92c813f9 PCMDIobs2/atmos/mon/rlut/CERES-EBAF-4-1/gn/v20200707/rlut_mon_CERES-EBAF-4-1_BE_gn_v20200707_200301-201812.nc
b6741c3f979b77a23509778f3a28403d PCMDIobs2/atmos/mon/pr/GPCP-2-3/gn/v20200707/pr_mon_GPCP-2-3_BE_gn_v20200707_197901-201907.nc
fc21b9030f19abb3f752bd0bf8e42c00 PCMDIobs2/atmos/mon/psl/20CR/gn/v20200707/psl_mon_20CR_BE_gn_v20200707_187101-201212.nc
f74b3785195105e5b931b17f3e7eac19 PCMDIobs2/atmos/mon/ts/HadISST-1-1/gn/v20200707/ts_mon_HadISST-1-1_BE_gn_v20200707_187001-201907.nc
1615175d54328d001b817c7e9cb56eeb PCMDIobs2/atmos/day/pr/GPCP-IP/gn/v20200719/pr_day_GPCP-IP_BE_gn_v20200719_19980101-19981231.nc
ce9aa736ee548e3dc20749de95b6f3fb CMIP5_demo_timeseries/historical/atmos/day/pr/pr_day_GISS-E2-H_historical_r6i1p1_20000101-20051231.nc
2e93205b96244292b10a666fd30ea7ea obs4MIPs_PCMDI_clims/rlut/CERES-EBAF-4-0/v20210804/rlut_mon_CERES-EBAF-4-0_PCMDI_gn.200301-201812.AC.v20210804.nc
9f3e08d6a4c2d62bce80fcd7d5ed16ee obs4MIPs_PCMDI_clims/rlut/CERES-EBAF-4-1/v20210804/rlut_mon_CERES-EBAF-4-1_PCMDI_gn.200301-201812.AC.v20210804.nc
3792901034585d3d495722f10a0dfecb obs4MIPs_PCMDI_clims/pr/GPCP-2-3/v20210804/pr_mon_GPCP-2-3_PCMDI_gn.200301-201812.AC.v20210804.nc
46535764dd4c32912944678eb0aa65c3 obs4MIPs_PCMDI_clims/zg/ERA-INT/v20210804/zg_mon_ERA-INT_PCMDI_gn.200301-201812.AC.v20210804.nc
d8fb93f31ff4a6370ccee93db82af86c obs4MIPs_PCMDI_monthly/ECMWF/ERA-INT/mon/zg/gn/v20210727/zg_mon_ERA-INT_PCMDI_gn_198901-201001.nc
61a639f0c8f3d11801352f37702aeaba obs4MIPs_PCMDI_monthly/NASA-LaRC/CERES-EBAF-4-1/mon/rlut/gn/v20210727/rlut_mon_CERES-EBAF-4-1_PCMDI_gn_200301-201812.nc
0877f014868b83547448f96c3e7c83e9 obs4MIPs_PCMDI_monthly/NOAA-NCEI/GPCP-2-3/mon/pr/gn/v20210727/pr_mon_GPCP-2-3_PCMDI_gn_197901-201907.nc
570ce90b3afd1d0b31690ae5dbe32d31 obs4MIPs_PCMDI_monthly/NOAA-ESRL-PSD/20CR/mon/psl/gn/v20210727/psl_mon_20CR_PCMDI_gn_187101-201212.nc
99c8691e0f615dc4d79b4fb5e926cc76 obs4MIPs_PCMDI_monthly/MOHC/HadISST-1-1/mon/ts/gn/v20210727/ts_mon_HadISST-1-1_PCMDI_gn_187001-201907.nc
10496775dae2b5f65fe95b064c1efd42 obs4MIPs_PCMDI_daily/NASA-JPL/GPCP-1-3/day/pr/gn/latest/pr_day_GPCP-1-3_PCMDI_gn_19961002-20170101.nc
eab076619d05c886648f33d507f4a721 misc_demo_data/atm/3hr/pr/pr_3hr_IPSL-CM5A-LR_historical_r1i1p1_5x5_1997-1999.nc
3214c2480d017662d78ae7e50542beaa misc_demo_data/fx/sftlf.GPCP-IP.1x1.nc
4 changes: 3 additions & 1 deletion doc/jupyter/Demo/download_sample_data.py
Original file line number Diff line number Diff line change
@@ -48,7 +48,9 @@ def generate_parameter_files(demo_data_directory, demo_output_directory, filenam
os.mkdir(demo_data_directory)

# Get the list of files, with md5 sums, and write to local file.
r = requests.get("https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_tutorial_files.v20220420.txt")
r = requests.get(
"https://pcmdiweb.llnl.gov/pss/pmpdata/pmp_tutorial_files.v20220420.txt"
)
data_files_txt = os.path.join(demo_data_directory, "data_files.txt")
with open(data_files_txt, "wb") as f:
f.write(r.content)
4 changes: 2 additions & 2 deletions pcmdi_metrics/diurnal/fourierFFT.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
X = numpy.fft.ifft(x)
a = X.real
b = X.imag
S = numpy.sqrt(a ** 2 + b ** 2)
S = numpy.sqrt(a**2 + b**2)
c = S[:, 0]
# time of maximum for nth component (n=0 => diurnal, n=1 => semi...)
tmax = numpy.zeros((nGridPoints, 3))
@@ -76,7 +76,7 @@ def fastAllGridFT(x, t):
print("Converting from complex-valued FFT to real-valued amplitude and phase ...")
a = X.real
b = X.imag
S = numpy.sqrt(a ** 2 + b ** 2)
S = numpy.sqrt(a**2 + b**2)
c = S[0] # Zeroth harmonic = mean-value "constant term" in Fourier series.
for n in range(3):
# Adding first + last terms, second + second-to-last, ...
6 changes: 3 additions & 3 deletions pcmdi_metrics/diurnal/scripts/savg_fourier.py
Original file line number Diff line number Diff line change
@@ -173,11 +173,11 @@ def spacevavg(tvarb1, tvarb2, sftlf, model):
sin_avg_ocn /= 1 - glolf
# Amplitude and phase:
# * 86400 Convert kg/m2/s -> mm/d?
amp_avg_glo = MV2.sqrt(sin_avg_glo ** 2 + cos_avg_glo ** 2)
amp_avg_glo = MV2.sqrt(sin_avg_glo**2 + cos_avg_glo**2)
# * 86400 Convert kg/m2/s -> mm/d?
amp_avg_lnd = MV2.sqrt(sin_avg_lnd ** 2 + cos_avg_lnd ** 2)
amp_avg_lnd = MV2.sqrt(sin_avg_lnd**2 + cos_avg_lnd**2)
# * 86400 Convert kg/m2/s -> mm/d?
amp_avg_ocn = MV2.sqrt(sin_avg_ocn ** 2 + cos_avg_ocn ** 2)
amp_avg_ocn = MV2.sqrt(sin_avg_ocn**2 + cos_avg_ocn**2)
pha_avg_glo = MV2.remainder(
rad_to_hrs(MV2.arctan2(sin_avg_glo, cos_avg_glo), clocktype), clocktype
)
6 changes: 5 additions & 1 deletion pcmdi_metrics/graphics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# init file
# isort: skip_file
from .share.plot_utils import add_logo, download_archived_results, combine_ref_dicts # noqa
from .share.plot_utils import (
add_logo,
download_archived_results,
combine_ref_dicts,
) # noqa
from .share.read_json_mean_clim import (
read_mean_clim_json_files,
normalize_by_median,
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ def parallel_coordinate_plot(
group2_name="group2",
comparing_models=None,
fill_between_lines=False,
fill_between_lines_colors=("green", "red")
fill_between_lines_colors=("green", "red"),
):
"""
Parameters
@@ -183,7 +183,10 @@ def parallel_coordinate_plot(
linewidth=0.1,
scale="count",
scale_hue=False,
palette={group1_name: violin_colors[0], group2_name: violin_colors[1]},
palette={
group1_name: violin_colors[0],
group2_name: violin_colors[1],
},
)

# Line or marker
@@ -208,15 +211,30 @@ def parallel_coordinate_plot(

# Fill between lines
if fill_between_lines and (comparing_models is not None):
if (isinstance(comparing_models, tuple)
or (isinstance(comparing_models, list) and len(comparing_models) == 2)):
if isinstance(comparing_models, tuple) or (
isinstance(comparing_models, list) and len(comparing_models) == 2
):
x = range(N)
m1 = model_names.index(comparing_models[0])
m2 = model_names.index(comparing_models[1])
y1 = zs[m1, :]
y2 = zs[m2, :]
ax.fill_between(x, y1, y2, where=y2 >= y1, facecolor=fill_between_lines_colors[0], interpolate=True)
ax.fill_between(x, y1, y2, where=y2 <= y1, facecolor=fill_between_lines_colors[1], interpolate=True)
ax.fill_between(
x,
y1,
y2,
where=y2 >= y1,
facecolor=fill_between_lines_colors[0],
interpolate=True,
)
ax.fill_between(
x,
y1,
y2,
where=y2 <= y1,
facecolor=fill_between_lines_colors[1],
interpolate=True,
)

ax.set_xlim(-0.5, N - 0.5)
ax.set_xticks(range(N))
@@ -317,7 +335,7 @@ def _to_pd_dataframe(
group1_name="group1",
group2_name="group2",
):
print('data.shape:', data.shape)
print("data.shape:", data.shape)
# Pandas dataframe for seaborn plotting
df = pd.DataFrame(data, columns=metric_names, index=model_names)
# Stack
Loading