Skip to content

Commit

Permalink
Merge branch 'SCECcode:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
bayonato89 authored Feb 27, 2024
2 parents 9a71bfe + b3895d1 commit edb49f6
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-sphinx-no-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build-docs

on:
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build_docs:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: docs

on:
push:
branches: [ master ]
branches: [ main ]

jobs:
build_docs:
Expand Down Expand Up @@ -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
Expand All @@ -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
3 changes: 3 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
28 changes: 23 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion csep/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.6.2"
__version__ = "0.6.3"

11 changes: 6 additions & 5 deletions csep/utils/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion docs/getting_started/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions examples/tutorials/plot_customizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand All @@ -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)

####################################################################################################################################

Expand Down
9 changes: 4 additions & 5 deletions tests/test_JmaCsvCatalog.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down Expand Up @@ -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)

0 comments on commit edb49f6

Please sign in to comment.