Skip to content

Commit 44cfa0e

Browse files
authored
Merge pull request #282 from cseptesting/v0.8.0-candidate
V0.8.0 candidate
2 parents 1c81958 + 6811ac4 commit 44cfa0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+49883
-1879
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ omit =
55
tests/*
66
docs/*
77
examples/*
8-
csep/utils/plots.py
98
csep/utils/constants.py
109
csep/utils/datasets.py
1110
csep/utils/documents.py

.github/workflows/build-sphinx-no-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: mamba-org/setup-micromamba@v1
1717
with:
1818
generate-run-shell: true
19-
environment-file: requirements.yml
19+
environment-file: environment.yml
2020
create-args: >-
2121
python=3.10
2222
pillow

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: mamba-org/setup-micromamba@v1
1717
with:
1818
generate-run-shell: true
19-
environment-file: requirements.yml
19+
environment-file: environment.yml
2020
create-args: >-
2121
python=3.9
2222
pillow

.github/workflows/build-test.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ name: tests
22

33
on:
44
push:
5-
branches-ignore:
6-
- 'v*'
5+
branches: [main]
76
pull_request:
87

98
jobs:
109
build:
11-
if: github.repository == 'SCECcode/pycsep'
10+
if: github.repository == 'cseptesting/pycsep'
1211
runs-on: ${{ matrix.os }}
1312
strategy:
1413
fail-fast: false
@@ -27,7 +26,7 @@ jobs:
2726
- uses: mamba-org/setup-micromamba@v1
2827
with:
2928
generate-run-shell: true
30-
environment-file: requirements.yml
29+
environment-file: environment.yml
3130
create-args: >-
3231
python=${{ matrix.python-version }}
3332
@@ -48,7 +47,7 @@ jobs:
4847
4948
5049
build_pip:
51-
if: github.repository == 'SCECcode/pycsep'
50+
if: github.repository == 'cseptesting/pycsep'
5251
runs-on: ${{ matrix.os }}
5352
strategy:
5453
fail-fast: false

.github/workflows/publish-pypi.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: mamba-org/setup-micromamba@v1
2020
with:
2121
generate-run-shell: true
22-
environment-file: requirements.yml
22+
environment-file: environment.yml
2323
create-args: >-
2424
python=3.10
2525
@@ -28,13 +28,13 @@ jobs:
2828
conda info -a
2929
conda list
3030
31-
- name: Create sdist
31+
- name: Create sdist and wheel
3232
run: |
33-
python setup.py check
34-
python setup.py sdist
33+
python -m pip install --upgrade pip build
34+
python -m build
3535
3636
- name: Publish Package
37-
uses: pypa/gh-action-pypi-publish@master
37+
uses: pypa/gh-action-pypi-publish@release/v1
3838
with:
3939
user: __token__
4040
password: ${{ secrets.pypi_upload_token }}
File renamed without changes.

MANIFEST.in

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ include README.md
22
include CONTRIBUTING.md
33
include CODE_OF_CONDUCT.md
44
include Dockerfile
5-
include LICENSE.txt
5+
include LICENSE
66
include CHANGELOG.md
77
include CREDITS.md
88
include codemeta.json
@@ -23,8 +23,5 @@ global-exclude .git*
2323
global-exclude *.pyc
2424
global-exclude *.html
2525
global-exclude *.so
26-
global-exclude *.xls
27-
global-exclude *.xlsm
28-
global-exclude *.xlsx
2926
global-exclude *~
3027
global-exclude .DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ Development of pyCSEP is a group effort. A list of developers that have contribu
8989
are listed in the [credits](CREDITS.md) file in this repository.
9090

9191
# License:
92-
The pyCSEP software is distributed under the BSD 3-Clause open-source license. Please see the [license](LICENSE.txt) file for more information.
92+
The pyCSEP software is distributed under the BSD 3-Clause open-source license. Please see the [license](LICENSE) file for more information.

csep/__init__.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import os
33
import time
44

5-
from csep._version import __version__
6-
75
from csep.core import forecasts
86
from csep.core import catalogs
97
from csep.core import poisson_evaluations
@@ -37,6 +35,13 @@
3735
utc_now_epoch
3836
)
3937

38+
from importlib.metadata import version as _pkg_version, PackageNotFoundError
39+
40+
try:
41+
__version__ = _pkg_version("pycsep")
42+
except PackageNotFoundError:
43+
__version__ = "0+unknown"
44+
4045
# this defines what is imported on a `from csep import *`
4146
__all__ = [
4247
'load_json',
@@ -80,8 +85,8 @@ def load_stochastic_event_sets(filename, type='csv', format='native',
8085
(generator): :class:`~csep.core.catalogs.AbstractBaseCatalog`
8186
8287
"""
83-
if type not in ('ucerf3', 'csv'):
84-
raise ValueError("type must be one of the following: (ucerf3)")
88+
if type not in ('ucerf3', 'csv', 'csep'):
89+
raise ValueError("type must be one of the following: (ucerf3, csv, csep)")
8590

8691
# use mapping to dispatch to correct function
8792
# in general, stochastic event sets are loaded with classmethods and single catalogs use the
@@ -105,7 +110,7 @@ def load_stochastic_event_sets(filename, type='csv', format='native',
105110
elif format == 'csep':
106111
yield catalog.get_csep_format()
107112
else:
108-
raise ValueError('format must be either "native" or "csep!')
113+
raise ValueError('format must be either "native" or "csep!"')
109114

110115

111116
def load_catalog(filename, type='csep-csv', format='native', loader=None,
@@ -333,7 +338,7 @@ def query_gns(start_time, end_time, min_magnitude=2.950,
333338
verbose (bool): print catalog summary statistics
334339
335340
Returns:
336-
:class:`csep.core.catalogs.CSEPCatalog
341+
:class:`csep.core.catalogs.CSEPCatalog`
337342
"""
338343

339344
# Timezone should be in UTC
@@ -366,7 +371,7 @@ def query_gcmt(start_time, end_time, min_magnitude=5.0,
366371
max_depth=None,
367372
catalog_id=None,
368373
min_latitude=None, max_latitude=None,
369-
min_longitude=None, max_longitude=None):
374+
min_longitude=None, max_longitude=None, verbose=True):
370375

371376
eventlist = readers._query_gcmt(start_time=start_time,
372377
end_time=end_time,
@@ -381,6 +386,17 @@ def query_gcmt(start_time, end_time, min_magnitude=5.0,
381386
name='gCMT',
382387
catalog_id=catalog_id,
383388
date_accessed=utc_now_datetime())
389+
390+
if verbose:
391+
print("Downloaded catalog from GCMT with following parameters")
392+
print("Start Date: {}\nEnd Date: {}".format(str(catalog.start_time),
393+
str(catalog.end_time)))
394+
print("Min Latitude: {} and Max Latitude: {}".format(catalog.min_latitude,
395+
catalog.max_latitude))
396+
print("Min Longitude: {} and Max Longitude: {}".format(catalog.min_longitude,
397+
catalog.max_longitude))
398+
print("Min Magnitude: {}".format(catalog.min_magnitude))
399+
print(f"Found {catalog.event_count} events in the gns catalog.")
384400
return catalog
385401

386402

csep/_version.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)