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 3b26bd6d..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: @@ -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 @@ -47,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 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/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/csep/utils/plots.py b/csep/utils/plots.py index 01d2c24d..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 @@ -1856,9 +1857,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 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 --------------------------------------------------- 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 diff --git a/examples/tutorials/plot_customizations.py b/examples/tutorials/plot_customizations.py index cf9fa804..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 ' @@ -120,8 +120,8 @@ # 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) + show=True, set_global=True, + plot_args=plot_args) #################################################################################################################################### 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)