From 2c55061b8f4521d741c2c5e27d007337a390602f Mon Sep 17 00:00:00 2001 From: Philip Maechling Date: Fri, 29 Sep 2023 14:35:09 -0700 Subject: [PATCH 01/10] Update build-sphinx.yml echo variables --- .github/workflows/build-sphinx.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 3b26bd6d..0f1dbb63 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -39,6 +39,9 @@ jobs: doc_root=`mktemp -d` rsync -av "docs/_build/html/" "${doc_root}/" pushd "${doc_root}" + echo "${doc_root}" + echo "${GITHUB_ACTOR}" + echo "${GITHUB_REPOSITORY}" git config --global user.name "${GITHUB_ACTOR}" git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" git init From 169fa2d341d931dcb96cdfa18c0e979284545bdb Mon Sep 17 00:00:00 2001 From: Philip Maechling Date: Fri, 29 Sep 2023 14:48:59 -0700 Subject: [PATCH 02/10] Update build-sphinx.yml remove redundant and failing date stamp --- .github/workflows/build-sphinx.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 0f1dbb63..94408aee 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -50,5 +50,5 @@ jobs: echo "Empty README.md for documenation cache." > README.md echo "docs.cseptesting.org" > CNAME git add . - git commit -am "Updating pyCSEP docs for commit ${GITHUB_SHA} made on `date -d"@{SOURCE_DATE_EPOCH} --iso-8601=seconds` from ${GITHUB_REF} by ${GITHUB_ACTOR}" + git commit -am "Updating pyCSEP docs for commit ${GITHUB_SHA} from ${GITHUB_REF} by ${GITHUB_ACTOR}" git push deploy gh-pages --force From 1e2badbc5559ceba241844343983dff8ca913025 Mon Sep 17 00:00:00 2001 From: Philip Maechling Date: Fri, 29 Sep 2023 15:04:48 -0700 Subject: [PATCH 03/10] Update plot_customizations.py Temp comment out plot call generating errors. --- examples/tutorials/plot_customizations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/tutorials/plot_customizations.py b/examples/tutorials/plot_customizations.py index cf9fa804..3a4c76de 100644 --- a/examples/tutorials/plot_customizations.py +++ b/examples/tutorials/plot_customizations.py @@ -119,9 +119,9 @@ # To plot a global forecast, we must assign the option ``set_global=True``, which is required by :ref:cartopy to handle # internally the extent of the plot -ax = plots.plot_spatial_dataset(numpy.log10(rate_sum), forecast.region, - show=True, set_global=True, - plot_args=plot_args) +# ax = plots.plot_spatial_dataset(numpy.log10(rate_sum), forecast.region, +# show=True, set_global=True, +# plot_args=plot_args) #################################################################################################################################### From 65451fbceaf76022fe97252cbb5cbe81203bd39e Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Thu, 16 Nov 2023 04:22:06 +0100 Subject: [PATCH 04/10] ga: updated github actions to trigger on main branch instead of master (#243) --- .github/workflows/build-sphinx-no-deploy.yml | 2 +- .github/workflows/build-sphinx.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-sphinx-no-deploy.yml b/.github/workflows/build-sphinx-no-deploy.yml index 1146d029..75844cd2 100644 --- a/.github/workflows/build-sphinx-no-deploy.yml +++ b/.github/workflows/build-sphinx-no-deploy.yml @@ -2,7 +2,7 @@ name: build-docs on: pull_request: - branches: [ master ] + branches: [ main ] jobs: build_docs: diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 94408aee..083f87b7 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -2,7 +2,7 @@ name: docs on: push: - branches: [ master ] + branches: [ main ] jobs: build_docs: From d764e5f9a4ba88ad13a005589b9383f69d1c69af Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Thu, 16 Nov 2023 04:38:06 +0100 Subject: [PATCH 05/10] fix: negbinom consistency plots now have the correct boundaries (#245) --- csep/utils/plots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/csep/utils/plots.py b/csep/utils/plots.py index 01d2c24d..e88cc1a7 100644 --- a/csep/utils/plots.py +++ b/csep/utils/plots.py @@ -1856,9 +1856,9 @@ def plot_consistency_test(eval_results, normalize=False, axes=None, mean = res.test_distribution[1] upsilon = 1.0 - ((var - mean) / var) tau = (mean ** 2 / (var - mean)) - phigh = scipy.stats.nbinom.ppf((1 - percentile / 100.) / 2., tau, + plow = scipy.stats.nbinom.ppf((1 - percentile / 100.) / 2., tau, upsilon) - plow = scipy.stats.nbinom.ppf(1 - (1 - percentile / 100.) / 2., + phigh = scipy.stats.nbinom.ppf(1 - (1 - percentile / 100.) / 2., tau, upsilon) # empirical distributions From 8fbdd95c907ee06bdf15d5e4908168b7f947baab Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Thu, 16 Nov 2023 05:28:11 +0100 Subject: [PATCH 06/10] fix: tutorial for plot_customizations. Changed projection to have a central longitude at 180. (#242) --- examples/tutorials/plot_customizations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tutorials/plot_customizations.py b/examples/tutorials/plot_customizations.py index 3a4c76de..87e4de2c 100644 --- a/examples/tutorials/plot_customizations.py +++ b/examples/tutorials/plot_customizations.py @@ -107,7 +107,7 @@ # We define the arguments and a global projection, centered at $lon=-180$ plot_args = {'figsize': (10,6), 'coastline':True, 'feature_color':'black', - 'projection': cartopy.crs.Robinson(central_longitude=-179.0), + 'projection': cartopy.crs.Robinson(central_longitude=180.0), 'title': forecast.name, 'grid_labels': False, 'cmap': 'magma', 'clabel': r'$\log_{10}\lambda\left(M_w \in [{%.2f},\,{%.2f}]\right)$ per ' @@ -119,9 +119,9 @@ # To plot a global forecast, we must assign the option ``set_global=True``, which is required by :ref:cartopy to handle # internally the extent of the plot -# ax = plots.plot_spatial_dataset(numpy.log10(rate_sum), forecast.region, -# show=True, set_global=True, -# plot_args=plot_args) +ax = plots.plot_spatial_dataset(numpy.log10(rate_sum), forecast.region, + show=True, set_global=True, + plot_args=plot_args) #################################################################################################################################### From fa43396dfde2d98a239ab747559b28054b048284 Mon Sep 17 00:00:00 2001 From: wsavran <35315438+wsavran@users.noreply.github.com> Date: Tue, 28 Nov 2023 23:35:58 -0800 Subject: [PATCH 07/10] removed shading when less than 3 forecasts (#247) fixes issue #214 Co-authored-by: William Savran --- csep/utils/plots.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/csep/utils/plots.py b/csep/utils/plots.py index e88cc1a7..08ef03ee 100644 --- a/csep/utils/plots.py +++ b/csep/utils/plots.py @@ -1758,9 +1758,9 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None): markerfacecolor=facecolor, markeredgecolor=color, markersize=markersize) + ax.set_xticks(numpy.arange(len(results_t))) ax.set_xticklabels([res.sim_name[0] for res in results_t], rotation=xticklabels_rotation, fontsize=xlabel_fontsize) - ax.set_xticks(numpy.arange(len(results_t))) ax.set_xlabel(xlabel) ax.set_ylabel(ylabel, fontsize=ylabel_fontsize) ax.set_title(title) @@ -1769,8 +1769,9 @@ def plot_comparison_test(results_t, results_w=None, axes=None, plot_args=None): ax.yaxis.set_major_locator(matplotlib.ticker.MaxNLocator(integer=True)) ax.set_ylim([ylim[0], ylim[1]]) ax.set_xlim([-0.5, len(results_t) - 0.5]) - ax.bar(xTickPos, numpy.array([9999] * len(xTickPos)), bottom=-2000, - width=(xTickPos[1] - xTickPos[0]), color=['gray', 'w'], alpha=0.2) + if len(results_t) > 2: + ax.bar(xTickPos, numpy.array([9999] * len(xTickPos)), bottom=-2000, + width=(xTickPos[1] - xTickPos[0]), color=['gray', 'w'], alpha=0.2) fig.tight_layout() return ax From d630678cd825dee365ebff097b1cfb14314b3610 Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Wed, 10 Jan 2024 02:41:14 +0100 Subject: [PATCH 08/10] docs: developer installation - added pip command to install developer dependencies (#246) --- docs/getting_started/installing.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/getting_started/installing.rst b/docs/getting_started/installing.rst index 868ee7cc..c37b8a41 100644 --- a/docs/getting_started/installing.rst +++ b/docs/getting_started/installing.rst @@ -98,9 +98,10 @@ We recommend using ``conda`` to install the development environment. :: cd pycsep conda env create -f requirements.yml conda activate csep-dev - pip install -e . + pip install -e .[all] # Allow sync with default repository git remote add upstream https://github.com/SCECCode/pycsep.git +This ensures to have a clean installation of ``pyCSEP`` and the required developer dependencies (e.g., ``pytest``, ``sphinx``). Now you can pull from upstream using ``git pull upstream master`` to keep your copy of the repository in sync with the latest commits. \ No newline at end of file From 083c5ca76b45edb4f335226c7687d25af6529d84 Mon Sep 17 00:00:00 2001 From: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com> Date: Wed, 10 Jan 2024 02:49:55 +0100 Subject: [PATCH 09/10] ga: added only windows 3.10 (#244) ga: updated github actions to test windows. fix jma tests ga: reverted to run GA on maaster(main) branch & fork --- .github/workflows/build-test.yml | 3 +++ tests/test_JmaCsvCatalog.py | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 289f6a14..ab681372 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -15,6 +15,9 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] python-version: ['3.7', '3.8', '3.9', '3.10'] + include: + - os: windows-latest + python-version: '3.10' defaults: run: shell: bash -l {0} diff --git a/tests/test_JmaCsvCatalog.py b/tests/test_JmaCsvCatalog.py index a971c454..ab748f1c 100644 --- a/tests/test_JmaCsvCatalog.py +++ b/tests/test_JmaCsvCatalog.py @@ -1,9 +1,7 @@ import unittest import csep - - +from csep.utils.time_utils import datetime_to_utc_epoch import os.path - import numpy def get_datadir(): @@ -43,8 +41,9 @@ def test_JmaCsvCatalog_loading(): # _datetimes.fill(numpy.nan) for _idx, _val in enumerate(_dummy): - _datetimes[_idx] = round(1000. * _val.timestamp()) + _datetimes[_idx] = datetime_to_utc_epoch(_val) numpy.testing.assert_allclose(_datetimes, test_catalog.catalog['origin_time'], err_msg='timestamp mismatch', - verbose=True, rtol=0, atol=0) + verbose=True, + rtol=1e-3, atol=0) From 132e4e91f6f445c87741edfc863189da61213697 Mon Sep 17 00:00:00 2001 From: Fabio Silva Date: Thu, 1 Feb 2024 11:11:44 -0800 Subject: [PATCH 10/10] Added changes for 0.6.3, bumped version number --- CHANGELOG.md | 28 +++++++++++++++++++++++----- codemeta.json | 4 ++-- csep/_version.py | 2 +- docs/conf.py | 2 +- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3698b331..0eff31c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,32 @@ +# v0.6.3 (2/1/2024) + +# Change-log + +Added test for Winodws 10 on GitHub actions ([#244](https://github.com/SCECcode/pycsep/pull/244)) +Removed shading in plotting fewer than 3 forecasts ([#247](https://github.com/SCECcode/pycsep/pull/247)) +Fixed tutorial for plot_customizations ([#242](https://github.com/SCECcode/pycsep/pull/242)) +Fixed negative binomial consistency plots now have the correct boundaries ([#245](https://github.com/SCECcode/pycsep/pull/245)) +Changed environment build of pypi-publish from miniconda to micromamba ([#238](https://github.com/SCECcode/pycsep/pull/238)) +Fixed negative timestamps parsing for Windows ([#230](https://github.com/SCECcode/pycsep/pull/230)) +Fixed writing catalog csv files on Windows ([#235](https://github.com/SCECcode/pycsep/pull/235)) + +## Credits +Pablo Iturrieta (@pabloitu) +William Savran (@wsavran) +Philip Maechling (@pjmaechling) +Fabio Silva (@fabiolsilva) + # v0.6.2 (6/16/2023) # Change-log -Fixed an error-bar bug for normalized consistency plots ([#222](https://github.com/SCECcode/pycsep/pull/222)) -Fixed handles URL exception or SSL verifications errors for both python 3.8 and 3.11 inclusive ([#231](https://github.com/SCECcode/pycsep/pull/231)) -Included CMT Catalog accessor ([#217](https://github.com/SCECcode/pycsep/pull/217)) +Fixed an error-bar bug for normalized consistency plots ([#222](https://github.com/SCECcode/pycsep/pull/222)) +Fixed handles URL exception or SSL verifications errors for both python 3.8 and 3.11 inclusive ([#231](https://github.com/SCECcode/pycsep/pull/231)) +Included CMT Catalog accessor ([#217](https://github.com/SCECcode/pycsep/pull/217)) Added NZ catalog reader ([#213](https://github.com/SCECcode/pycsep/pull/213)) ## Credits -Pablo Iturrieta (@pabloitu) -Kenny Graham (@KennyGraham1) +Pablo Iturrieta (@pabloitu) +Kenny Graham (@KennyGraham1) Fabio Silva (@fabiolsilva) # v0.6.1 (12/12/2022) diff --git a/codemeta.json b/codemeta.json index 76148cb7..7462c0b1 100644 --- a/codemeta.json +++ b/codemeta.json @@ -5,11 +5,11 @@ "codeRepository": "https://github.com/SCECcode/pycsep.git", "dateCreated": "2021-10-31", "datePublished": "2020-10-20", - "dateModified": "2023-06-16", + "dateModified": "2024-02-01", "downloadUrl": "https://github.com/SCECcode/pycsep", "issueTracker": "https://github.com/SCECcode/pycsep/issues", "name": "pyCSEP", - "version": "v0.6.2", + "version": "v0.6.3", "description": "The pyCSEP Toolkit helps earthquake forecast model developers evaluate their forecasts with the goal of understanding earthquake predictability.", "applicationCategory": "Seismology", "developmentStatus": "active", diff --git a/csep/_version.py b/csep/_version.py index 9614f306..0620b272 100644 --- a/csep/_version.py +++ b/csep/_version.py @@ -1,2 +1,2 @@ -__version__ = "0.6.2" +__version__ = "0.6.3" diff --git a/docs/conf.py b/docs/conf.py index 0a8a1366..208045ef 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,7 +30,7 @@ # The short X.Y version version = 'v0.6' # The full version, including alpha/beta/rc tags -release = 'v0.6.2' +release = 'v0.6.3' # -- General configuration ---------------------------------------------------