Skip to content

Commit d141261

Browse files
authored
Merge pull request #32 from PCMDI/lee1043-patch-1
Bump version to 0.2.1
2 parents f7746b3 + 2a39fc5 commit d141261

File tree

11 files changed

+182
-79
lines changed

11 files changed

+182
-79
lines changed

.setup.cfg renamed to .flake8.cfg

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,3 @@ exclude =
3131
venv
3232
*json
3333
*md
34-
35-
36-
37-
[tool:pytest]
38-
junit_family = xunit2
39-
addopts = --cov=ESMBenchmarkViz --cov-report term --cov-report html:tests_coverage_reports/htmlcov --cov-report xml:tests_coverage_reports/coverage.xml -s --ignore tests/deprecated
40-
python_files = tests.py test_*.py

.github/workflows/build_workflow.yml

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,58 +32,62 @@ jobs:
3232
timeout-minutes: 10
3333
steps:
3434
- name: Checkout Code Repository
35-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3636

3737
- name: Set up Python
38-
uses: actions/setup-python@v4
38+
uses: actions/setup-python@v5
3939
with:
40-
python-version: '3.10'
40+
python-version: '3.13'
4141

4242
- name: Install and Run Pre-commit
43-
uses: pre-commit/[email protected].0
43+
uses: pre-commit/[email protected].1
4444

4545
build:
4646
needs: check-jobs-to-skip
4747
if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }} || ${{ github.event_name == 'push' }}
4848
runs-on: ubuntu-latest
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
python-version: ["3.10", "3.11", "3.12", "3.13"]
4953
defaults:
5054
run:
5155
shell: bash -l {0}
5256
timeout-minutes: 10
5357
steps:
54-
- uses: actions/checkout@v3
58+
- uses: actions/checkout@v4
59+
- name: Get Date
60+
id: get-date
61+
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
5562

5663
- name: Set up Conda Environment
57-
uses: conda-incubator/setup-miniconda@v2
64+
uses: conda-incubator/setup-miniconda@v3
5865
with:
59-
activate-environment: "ESMBenchmarkViz_ci"
60-
miniforge-variant: Mambaforge
66+
miniforge-variant: Miniforge3
6167
miniforge-version: latest
68+
activate-environment: "ESMBenchmarkViz_ci"
6269
environment-file: conda-env/environment.yml
63-
use-mamba: true
64-
mamba-version: "*"
65-
channel-priority: strict
70+
channel-priority: flexible
6671
auto-update-conda: true
72+
python-version: ${{ matrix.python-version }}
73+
use-mamba: false
74+
conda-solver: classic
6775

68-
# Used for refreshing the cache every 24 hours to avoid inconsistencies of package
69-
# versions between the CI pipeline and local installations.
70-
- name: Get Date
71-
id: get-date
72-
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
73-
shell: bash
74-
75-
- name: Cache Conda
76-
uses: actions/cache@v3
76+
- name: Cache Conda Packages
77+
uses: actions/cache@v4
7778
with:
78-
path: ${{ env.CONDA }}/envs
79-
key:
80-
conda-${{ runner.os }}--${{ runner.arch }}--${{
81-
steps.get-date.outputs.today }}-${{
82-
hashFiles('conda-env/environment.yml') }}-${{ env.CACHE_NUMBER}}
79+
path: ~/conda_pkgs_dir
80+
key: conda-${{ runner.os }}--${{ runner.arch }}--py${{ matrix.python-version }}--${{ steps.get-date.outputs.today }}--${{ hashFiles('conda-env/environment.yml') }}--${{ env.CACHE_NUMBER }}
8381
env:
84-
# Increase this value to reset cache if conda/environment.yml has not changed in the workflow
8582
CACHE_NUMBER: 0
8683

84+
- name: Verify Conda Environment
85+
run: |
86+
conda info
87+
conda list
88+
conda config --show-sources
89+
conda config --show
90+
8791
- name: Install ESMBenchmarkViz
8892
# Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
8993
run: |
@@ -121,14 +125,24 @@ jobs:
121125
hashFiles('conda-env/environment.yml') }}
122126

123127
- name: Set up Conda Environment
124-
uses: conda-incubator/setup-miniconda@v2
128+
uses: conda-incubator/setup-miniconda@v3
125129
with:
126-
activate-environment: "ESMBenchmarkViz_dev"
130+
activate-environment: "ESMBenchmarkViz_ci"
131+
environment-file: conda-env/environment.yml
127132
miniforge-variant: Miniforge3
128133
miniforge-version: latest
129-
environment-file: conda-env/environment.yml
130134
channel-priority: strict
131135
auto-update-conda: true
136+
use-mamba: false
137+
conda-solver: classic
138+
python-version: '3.13'
139+
140+
- name: Verify Conda Environment
141+
run: |
142+
conda info
143+
conda list
144+
conda config --show-sources
145+
conda config --show
132146
133147
- name: Install ESMBenchmarkViz
134148
# Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
# General file formatters
1010
# =======================
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.4.0
12+
rev: v6.0.0
1313
hooks:
1414
- id: trailing-whitespace
1515
args: [--markdown-linebreak-ext=md]
@@ -20,12 +20,12 @@ repos:
2020
# Python code formatters
2121
# =======================
2222
- repo: https://github.com/psf/black
23-
rev: 23.3.0
23+
rev: 25.1.0
2424
hooks:
2525
- id: black
2626

2727
- repo: https://github.com/timothycrosley/isort
28-
rev: 5.13.2
28+
rev: 6.0.1
2929
hooks:
3030
- id: isort
3131
args: ['--settings-path', '.isort.cfg']
@@ -34,8 +34,8 @@ repos:
3434
# Python linting
3535
# =======================
3636
- repo: https://github.com/pycqa/flake8
37-
rev: 7.0.0
37+
rev: 7.3.0
3838
hooks:
3939
- id: flake8
40-
args: ["--config=.setup.cfg"]
40+
args: ["--config=.flake8.cfg"]
4141
additional_dependencies: [flake8-isort]

CITATION.cff

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ authors:
1313
1414
affiliation: Lawrence Livermore National Laboratory
1515
orcid: 'https://orcid.org/0000-0002-0016-7199'
16+
- given-names: Kristin
17+
family-names: Chang
18+
affiliation: Lawrence Livermore National Laboratory
19+
identifiers:
20+
- type: doi
21+
value: 10.5281/zenodo.14498167
22+
description: Software
1623
repository-code: 'https://github.com/PCMDI/ESMBenchmarkViz'
17-
abstract: ' A Python package for interactive visualizations for Earth System Model evaluation and benchmarking.'
24+
abstract: ' A Python toolkit for interactive visualizations for Earth System Model evaluation and benchmarking.'
25+
keywords:
26+
- climate
27+
- climate modeling
28+
- climate model evaluation
29+
- Earth System Model evaluation
1830
license: BSD-3-Clause
31+
version: '0.2.1'
32+
date-released: '2025-10-16'

ESMBenchmarkViz/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.0"
1+
__version__ = "0.2.1"

ESMBenchmarkViz/core_portrait_plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ def portrait_plot(
248248
if len(field2) > 0:
249249
col_dict.update(dict(field2=field2))
250250
col_dict_df = pd.DataFrame.from_dict(col_dict)
251-
col_dict_df.loc[
252-
col_dict_df.field2.isna(), ("img")
253-
] = "https://pcmdi.llnl.gov/pmp-preliminary-results/interactive_plot/mean_climate/no-data-whitebg.png"
251+
col_dict_df.loc[col_dict_df.field2.isna(), ("img")] = (
252+
"https://pcmdi.llnl.gov/pmp-preliminary-results/interactive_plot/mean_climate/no-data-whitebg.png"
253+
)
254254
col_dict.update(dict(img=col_dict_df["img"].tolist()))
255255

256256
# if position_list is not None, update col_dict with position_list

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ensure custom build backend and generator script are included in sdist
2+
recursive-include _custom_build *.py

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
[![Formatted with black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
1313

1414

15-
ESMBenchmarkViz is a Python-based interactive visualization tool built with Bokeh, designed to facilitate the collective evaluation, intercomparison, and benchmarking of Earth System Models (ESMs). The tool provides a user-friendly interface for analyzing model performance, enabling researchers to make informed comparisons and insights into ESM behavior.
15+
ESMBenchmarkViz is a Python-based interactive visualization toolkit built with Bokeh, designed to facilitate the collective evaluation, intercomparison, and benchmarking of Earth System Models (ESMs). The tool provides a user-friendly interface for analyzing model performance, enabling researchers to make informed comparisons and insights into ESM behavior.
1616

1717
## Developer
1818

19-
Jiwoo Lee ([@lee1043](https://github.com/PCMDI/ESMBenchmarkViz/commits?author=lee1043), [LLNL][LLNL])
19+
Jiwoo Lee ([@lee1043](https://github.com/PCMDI/ESMBenchmarkViz/commits?author=lee1043), [LLNL][LLNL]), Kristin Chang ([@kristinchang3](https://github.com/PCMDI/ESMBenchmarkViz/commits?author=kristinchang3), [LLNL][LLNL])
2020

2121
## Interactive Taylor Diagram
2222
![Taylor Diagram](docs/_static/example_taylor_diagram.gif)
@@ -27,11 +27,13 @@ Jiwoo Lee ([@lee1043](https://github.com/PCMDI/ESMBenchmarkViz/commits?author=le
2727

2828
| <div style="width:300%">[Versions]</div> | Update summary |
2929
| ------------- | ------------------------------------------- |
30+
| [v0.2.1] | Technical update
3031
| [v0.2.0] | Scatter plot and Portrait plot added
3132
| [v0.1.0] | Taylor Diagram with diagnostic figure pop up capability
3233
| [v0.0.1] | Initial release for interactive Taylor Diagram
3334

3435
[Versions]: https://github.com/PCMDI/ESMBenchmarkViz/releases
36+
[v0.2.1]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.2.1
3537
[v0.2.0]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.2.0
3638
[v0.1.0]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.1.0
3739
[v0.0.1]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.0.1

_custom_build/backend.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from __future__ import annotations
2+
3+
from pathlib import Path
4+
5+
from setuptools import build_meta as _orig
6+
from setuptools.build_meta import * # noqa: F401,F403 - re-export PEP 517 hooks
7+
8+
_PROJECT_ROOT = Path(__file__).resolve().parent.parent
9+
10+
11+
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): # type: ignore[override]
12+
return _orig.build_wheel(wheel_directory, config_settings, metadata_directory)
13+
14+
15+
def build_sdist(sdist_directory, config_settings=None): # type: ignore[override]
16+
return _orig.build_sdist(sdist_directory, config_settings)
17+
18+
19+
def build_editable(wheel_directory, config_settings=None, metadata_directory=None): # type: ignore[override]
20+
# PEP 660 editable install hook (pip -e). Ensure the file exists here too.
21+
return _orig.build_editable(wheel_directory, config_settings, metadata_directory)
22+
23+
24+
def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None): # type: ignore[override]
25+
return _orig.prepare_metadata_for_build_wheel(metadata_directory, config_settings)
26+
27+
28+
def prepare_metadata_for_build_editable(metadata_directory, config_settings=None): # type: ignore[override]
29+
return _orig.prepare_metadata_for_build_editable(
30+
metadata_directory, config_settings
31+
)

pyproject.toml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
###############################################
2+
# Build system and project metadata (PEP 621) #
3+
###############################################
4+
5+
[build-system]
6+
requires = ["setuptools>=69", "wheel"]
7+
# Use an in-tree backend wrapper so we can run a pre-build step
8+
build-backend = "backend"
9+
backend-path = ["_custom_build"]
10+
11+
[project]
12+
name = "ESMBenchmarkViz"
13+
description = "A Python toolkit for interactive visualizations for Earth System Model evaluation and benchmarking"
14+
readme = "README.md"
15+
requires-python = ">=3.10,<3.14"
16+
license = { file = "LICENSE" }
17+
classifiers = [
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"License :: OSI Approved :: BSD License",
24+
"Operating System :: OS Independent",
25+
]
26+
dynamic = ["version"]
27+
28+
[project.urls]
29+
Homepage = "https://github.com/PCMDI/ESMBenchmarkViz"
30+
31+
[tool.setuptools.packages.find]
32+
include = ["ESMBenchmarkViz*"]
33+
exclude = ["tests", "misc_scripts", "docs", "_custom_build", "conda-env"]
34+
35+
[tool.setuptools.dynamic]
36+
version = { attr = "ESMBenchmarkViz._version.__version__" }
37+
38+
#########################
39+
# Lint/Test configuration
40+
#########################
41+
42+
[tool.black]
43+
line-length = 88
44+
target-version = ['py310', 'py311', 'py312', 'py313']
45+
include = '\.pyi?$'
46+
exclude = '''
47+
(
48+
/(
49+
\.eggs
50+
| \.git
51+
| \.hg
52+
| \.mypy_cache
53+
| \.tox
54+
| \.idea
55+
| venv
56+
| _build
57+
| buck-out
58+
| build
59+
| dist
60+
| docs
61+
| config
62+
)/
63+
)
64+
'''
65+
66+
[tool.isort]
67+
# Docs: https://pycqa.github.io/isort/docs/configuration/options.html#example-pyprojecttoml_4
68+
multi_line_output = 3
69+
include_trailing_comma = true
70+
force_grid_wrap = 0
71+
use_parentheses = true
72+
line_length = 88
73+
74+
[tool.pytest.ini_options]
75+
# Docs: https://docs.pytest.org/en/7.2.x/reference/customize.html#configuration
76+
junit_family = "xunit2"
77+
addopts = "--cov=ESMBenchmarkViz --cov-report term --cov-report html:tests_coverage_reports/htmlcov --cov-report xml:tests_coverage_reports/coverage.xml -s --ignore tests/deprecated"
78+
python_files = ["tests.py", "test_*.py"]

0 commit comments

Comments
 (0)