Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions .setup.cfg → .flake8.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,3 @@ exclude =
venv
*json
*md



[tool:pytest]
junit_family = xunit2
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
python_files = tests.py test_*.py
72 changes: 43 additions & 29 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,58 +32,62 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout Code Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'

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

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

- name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "ESMBenchmarkViz_ci"
miniforge-variant: Mambaforge
miniforge-variant: Miniforge3
miniforge-version: latest
activate-environment: "ESMBenchmarkViz_ci"
environment-file: conda-env/environment.yml
use-mamba: true
mamba-version: "*"
channel-priority: strict
channel-priority: flexible
auto-update-conda: true
python-version: ${{ matrix.python-version }}
use-mamba: false
conda-solver: classic

# Used for refreshing the cache every 24 hours to avoid inconsistencies of package
# versions between the CI pipeline and local installations.
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Conda
uses: actions/cache@v3
- name: Cache Conda Packages
uses: actions/cache@v4
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('conda-env/environment.yml') }}-${{ env.CACHE_NUMBER}}
path: ~/conda_pkgs_dir
key: conda-${{ runner.os }}--${{ runner.arch }}--py${{ matrix.python-version }}--${{ steps.get-date.outputs.today }}--${{ hashFiles('conda-env/environment.yml') }}--${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if conda/environment.yml has not changed in the workflow
CACHE_NUMBER: 0

- name: Verify Conda Environment
run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Install ESMBenchmarkViz
# Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
run: |
Expand Down Expand Up @@ -121,14 +125,24 @@ jobs:
hashFiles('conda-env/environment.yml') }}

- name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "ESMBenchmarkViz_dev"
activate-environment: "ESMBenchmarkViz_ci"
environment-file: conda-env/environment.yml
miniforge-variant: Miniforge3
miniforge-version: latest
environment-file: conda-env/environment.yml
channel-priority: strict
auto-update-conda: true
use-mamba: false
conda-solver: classic
python-version: '3.13'

- name: Verify Conda Environment
run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Install ESMBenchmarkViz
# Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
# General file formatters
# =======================
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
Expand All @@ -20,12 +20,12 @@ repos:
# Python code formatters
# =======================
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 25.1.0
hooks:
- id: black

- repo: https://github.com/timothycrosley/isort
rev: 5.13.2
rev: 6.0.1
hooks:
- id: isort
args: ['--settings-path', '.isort.cfg']
Expand All @@ -34,8 +34,8 @@ repos:
# Python linting
# =======================
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.3.0
hooks:
- id: flake8
args: ["--config=.setup.cfg"]
args: ["--config=.flake8.cfg"]
additional_dependencies: [flake8-isort]
16 changes: 15 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ authors:
email: [email protected]
affiliation: Lawrence Livermore National Laboratory
orcid: 'https://orcid.org/0000-0002-0016-7199'
- given-names: Kristin
family-names: Chang
affiliation: Lawrence Livermore National Laboratory
identifiers:
- type: doi
value: 10.5281/zenodo.14498167
description: Software
repository-code: 'https://github.com/PCMDI/ESMBenchmarkViz'
abstract: ' A Python package for interactive visualizations for Earth System Model evaluation and benchmarking.'
abstract: ' A Python toolkit for interactive visualizations for Earth System Model evaluation and benchmarking.'
keywords:
- climate
- climate modeling
- climate model evaluation
- Earth System Model evaluation
license: BSD-3-Clause
version: '0.2.1'
date-released: '2025-10-16'
2 changes: 1 addition & 1 deletion ESMBenchmarkViz/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.0"
__version__ = "0.2.1"
6 changes: 3 additions & 3 deletions ESMBenchmarkViz/core_portrait_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ def portrait_plot(
if len(field2) > 0:
col_dict.update(dict(field2=field2))
col_dict_df = pd.DataFrame.from_dict(col_dict)
col_dict_df.loc[
col_dict_df.field2.isna(), ("img")
] = "https://pcmdi.llnl.gov/pmp-preliminary-results/interactive_plot/mean_climate/no-data-whitebg.png"
col_dict_df.loc[col_dict_df.field2.isna(), ("img")] = (
"https://pcmdi.llnl.gov/pmp-preliminary-results/interactive_plot/mean_climate/no-data-whitebg.png"
)
col_dict.update(dict(img=col_dict_df["img"].tolist()))

# if position_list is not None, update col_dict with position_list
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ensure custom build backend and generator script are included in sdist
recursive-include _custom_build *.py
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
[![Formatted with black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)


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.
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.

## Developer

Jiwoo Lee ([@lee1043](https://github.com/PCMDI/ESMBenchmarkViz/commits?author=lee1043), [LLNL][LLNL])
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])

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

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

[Versions]: https://github.com/PCMDI/ESMBenchmarkViz/releases
[v0.2.1]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.2.1
[v0.2.0]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.2.0
[v0.1.0]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.1.0
[v0.0.1]: https://github.com/PCMDI/ESMBenchmarkViz/releases/tag/v0.0.1
Expand Down
31 changes: 31 additions & 0 deletions _custom_build/backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from __future__ import annotations

from pathlib import Path

from setuptools import build_meta as _orig
from setuptools.build_meta import * # noqa: F401,F403 - re-export PEP 517 hooks

_PROJECT_ROOT = Path(__file__).resolve().parent.parent


def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): # type: ignore[override]
return _orig.build_wheel(wheel_directory, config_settings, metadata_directory)


def build_sdist(sdist_directory, config_settings=None): # type: ignore[override]
return _orig.build_sdist(sdist_directory, config_settings)


def build_editable(wheel_directory, config_settings=None, metadata_directory=None): # type: ignore[override]
# PEP 660 editable install hook (pip -e). Ensure the file exists here too.
return _orig.build_editable(wheel_directory, config_settings, metadata_directory)


def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None): # type: ignore[override]
return _orig.prepare_metadata_for_build_wheel(metadata_directory, config_settings)


def prepare_metadata_for_build_editable(metadata_directory, config_settings=None): # type: ignore[override]
return _orig.prepare_metadata_for_build_editable(
metadata_directory, config_settings
)
78 changes: 78 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
###############################################
# Build system and project metadata (PEP 621) #
###############################################

[build-system]
requires = ["setuptools>=69", "wheel"]
# Use an in-tree backend wrapper so we can run a pre-build step
build-backend = "backend"
backend-path = ["_custom_build"]

[project]
name = "ESMBenchmarkViz"
description = "A Python toolkit for interactive visualizations for Earth System Model evaluation and benchmarking"
readme = "README.md"
requires-python = ">=3.10,<3.14"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
]
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/PCMDI/ESMBenchmarkViz"

[tool.setuptools.packages.find]
include = ["ESMBenchmarkViz*"]
exclude = ["tests", "misc_scripts", "docs", "_custom_build", "conda-env"]

[tool.setuptools.dynamic]
version = { attr = "ESMBenchmarkViz._version.__version__" }

#########################
# Lint/Test configuration
#########################

[tool.black]
line-length = 88
target-version = ['py310', 'py311', 'py312', 'py313']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.idea
| venv
| _build
| buck-out
| build
| dist
| docs
| config
)/
)
'''

[tool.isort]
# Docs: https://pycqa.github.io/isort/docs/configuration/options.html#example-pyprojecttoml_4
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88

[tool.pytest.ini_options]
# Docs: https://docs.pytest.org/en/7.2.x/reference/customize.html#configuration
junit_family = "xunit2"
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"
python_files = ["tests.py", "test_*.py"]
31 changes: 0 additions & 31 deletions setup.py

This file was deleted.

Loading