Skip to content

Commit 6eae6c9

Browse files
bch0wBryant Chow
andauthored
Pyatoa v0.3.0 (#39)
* bugfix: pinning cartopy and proj dependency versions as this was causing some issue with proj versions on systems that did not already have proj * bugfixing manager.write not able to write windows and adjoint sources if config.save_to_ds is set to False. This is unintended because write() is called explicitely and should force write, whereas save_to_ds is used to stop passive writing during the processing phase. Also threw in a check for ASDFDataSets opened in read-only during write() which would throw an error * bugfix changing a print statement in read_sem to a logger warning * removed pyaflowa from core objects, removed its tests and docs pages/references. Pyaflowa functionality has been completely shifted to SeisFlows * moved docs up to highest level directory to remove it from main dir and to match seisflows structure changed docs conf to point to the correct location updated changelog with most recent changes * Update README.md * udpating readthedocs.yaml to point to new docs location in package * pinning SciPy<=1.8.0 because SciPy==1.9.0 causes 'ValueErro: Unknown window type' because they changed name 'Hanning' -> 'Hann' causing errors in ObsPy * fixing setup procedure to avoid installing unnecessary requirements via pip * unpinning lowest scipy version due to Conda UnsatisfiedError package dependency conflicts during requirements installation * bugfixing time offset and waveform misfit naming * critical bug fix with filtering behavior for highpass and lowpass flipped from expected behavior. i.e., setting only min period used to set a highpass which is NOT what we want. This has been fixed * Remove external data gathering and I/O routines from Pyatoa (#23) * stripped away all moment tensor related functionality from the gatherer and plugins * further removed moment tensor related functionality and moved into pysep * stripped out I/O read and write functions related to SPECFEM which were redundant with respect to PySEP. replaced internal import statements with imports to pysep * stripped out all references to FDSN client in Pyatoa and all gathering that queried FDSN. This functionality will be shifted into PySEP * Removed now defunct docs related to gathering, updated changelog to reflect major changes made in this branch, removed failing tests that relied on removed functionality * update readme to remove reference of data fetchign * fixed missing comma in setup file * Update docs and install (#28) * removed setup.py and .cfg, implemented new pyproject.toml file replacing setup.py. pointed readthedocs to only requirements.txt file in docs directory. removed changelog in preference to set changelog in docs page * removed requirements.txt file * fixed missing suffixes in git dependencies of pyproject.toml file * docs added readme, moved notebooks into own directory, updated convert script. updating docs wording * updated overview page (slimmed down considerably) and bumped version number in conf * setting default filter periods to None and removing float requirement on input * pyflex requires a min period so setting to 1-100 rather than previous 10-30 * moved unused plot scripts out of repo (into simutil), removed unnecessary mgmt plot and moved into manager.plot() function * updated docs environment and main environment * update readme to match seisflows readme * removed manager and config notebooks and converted to a direct rst document added first glance to replace getting started * throws in a '*' on synthetic data gathering to deal with specfem3d_globe synthetics which suffix with 'ascii' * added data discovery rst doc page which is meant to replace the gatherer notebook and page * removed gatherer notebook and rst page * renames storage notebook * manually edited inspector rst doc file to be shorter and remove the notebook dependence. figures will be moved into the gallery * changed core_func name to misfit, for misfit quantifictaion * removed inspector notebook in favor of hand edited inspector doc page * updated naming standards page * cleaned out the scripts directory which had a lot of scripts that were unfinished or not used. ones that were important were moved into docs * bugfix inspector raypath plot checking incorrect logic * fixed bugfix * removed old image files from notebooks that are no longer required added an inspector gallery notebook and added rst to gallery page further cleaned up script repository added a load example inspector script * removed logging docs page and notebook, moved a short section into the misfit docs page * manually edited the storage rst file to be more concise and to move away from the notebook configuration. * removed storage notebook in favor of new .rst storage file * added outputs to code cells in inspector doc where relevant, changed ASDFDataSet example reading function to read only to not affect test data * added inspector figure text into gallery and removed text from inspector rst file * removing warnings from insp_gallery * renamed insp gallery notebook to avoid conversion deleting the manually edited version * condensed changelog to remove 0.3.0 changelog since we haven't even bumped to 0.2.0 removed make figures scripts directory * added github relevant files including different issue templates added contributing page modfieid from Pygmt * editing contributing document added cross-referencing into the misfit docs page * fixing typos misfit doc page * added cross-referencing to the storage docs page * finished adding cross-referencing into all docs pages of relevance * removed unnused 'read_seisflows_yaml' from Config class * major config and preprocessing reworking to allow for data-data misfit: removed unnused parameters 'start_pad', 'end_pad' from config, as well as filter corners removed seisflows_yaml and _par reading functionality from config, not necessary preprocess function now written more generally, does not take manager as input but rather takes stream and a few other arguments. manager preprocessing function changed to match * finished updating preprocessing function cleaned up logging statements, shortened and exchanged some 'info' for 'debug' statments * working data data example with some TA array data * renamed some files, cleaned up some docs text * last minute doc fixes * update changelog * fix tests which changed due to a change in default config parameters, removed some ununused test data, upated baseline images * bumping version number 0.2.0 for soft release * removing setup * removing setup requirement from readthedocs * doc fixed incorrect URL * Accomodate Pyadjoint API change (#30) * Pyadjoint v0.2.0 updates some API, fixing within Pyatoa tests, Config and Manager * renaming some internal Config parameters to match with Pyadjoint naming schema. Fixed texts for new Config system in PYadjoint * added new test dataset and script to make it. updated tests to reflect new dataset * added Manager.flow_multiband() function which takes multiple period bands as input and returns an averaged adjoint source to address #24 (#26) * Feature mpi (#31) * added an MPI data processing script and related data * added docs page with mpi code snippet and explanation * Revert "added docs page with mpi code snippet and explanation" This reverts commit 8a86339. * Revert "Revert "added docs page with mpi code snippet and explanation"" This reverts commit 91dfdb1. * removing autoapi * cleaning up mpi example doc page * divy -> divvy as per NG * update changelog * Update ex_w_mpi.rst added shebang to mpi example script * Update ex_w_mpi.rst Updates MPI example script with information about where results are stored, and fix in the code about number of events/stations * bugfix reduced number of ev-sta paris in mpi example problem script * Update ex_w_mpi.rst typo fix * updates dependencies of pysep and pyadjoint to point to pip installs rather than github links * add missing comma * remove adjtomo github links from environment yaml file * update changelog * remove pyflex github link, point straight to PyPi version * bump version 0.2.1 * bugfix: gatherer was using a removed config parameter causing it to fail when looking for observed data * update changelog and bump version number * installation: resolving deprecation warning: pypdf2 -> pypdf * bugfix incorrect import case for pypdf * update deprecated function name * update readme pypi locaiton * update changelog * Bugfix numerical noise (#35) * added new test to catch Issue \#34, which describes introduction of sub-sample time shifts when resampling data that already has the correct sampling rate * fixed test filtering above nyquist, low freq example still works added a flow control statement to skip resampling if sampling rates are already the same to prevent unncessary resampling of data which can cause sub-sample time shifts * update changelog and add ridvan to contributors * Refactor API for simplicity and to remove unnecessary abstraction (#38) * added feature to allow amplitude normalization during the standardization procedure * GATHERER OVERHAUL: core.gatherer -> utils.gather, demoted from core class to utility package utils.gather functions are being stripped down to bare essentials, no more reliance on internal path attributes etc. manager.gather -> manager.gather_from_dataset, used to get internal data from a dataset the underlying motivation here is to make data gathering much more explicit because it is currently very stupidly implicit and difficult to track/manipulate * fully stripped out all unncessary gathering routines which were just redundant fluff and weird abstractions that did not require their own class. the leftovers are two main functions which are used to read events that are not acceptable in ObsPy, and to gather waveform data directly from SEED structured directories * moved gather routines into the already existing 'read' utility function * remove gatherer import from package init * removed manager.gather_from_dataset function because I realized that load already does this * fully removed any reference to 'paths' from Config class as this feature of the package was pretty abstract and not really useful other than in a very specific working case * removed config parameters 'save_to_ds' because gatherer has been cut out removed 'pyflex_preset' config parameter because this was not a useful setup reworked config pyflex and pyadjoint config setting to be much simpler as it was sort of abstracted behind functions before, now its just directly calling the underlying config objects changed default values for config min and max period to 1-100 * removed lingering references to 'pyflex_preset' Config attribute * remove lingering calls to 'pyflex_preset' REMOVED all saving to dataset that occurs during processing, this is saved completely for the 'write' function which is renamed 'write_to_dataset' for clarity removed 'save' argument in window and measure to reflect point 1' * added choices parameter to Manager write_to_dataset function to allow selectively saving. also by default this function writes config object now * RESTRUCTURE preprocessing to move default preprocessing directly into the Manager.preprocess function, rather than obscuring it behind a utility function. parameters are set directly in the preprocessing function to be more exlicit. response removal is turned OFF by default changed some function names and allowed both st_obs and st_syn to run through response removal and STF convolution depending on their data type * fully migrated read functions OUT of Pyatoa and into PySEP (or SeisFlows). the intention here is that Pyatoa is simply a misfit quantification package, anything to do with reading files should be left to PySEP * map maker was fetching lat/lon values from inventory at the channel level but Inventories read from SPECFEM STATIONS files will not have the channel level. reduced this to station level which will also have lat and lon values which should anyways be the same as the channel level * map maker was trying to access magnitude information which is not always present in an Event object. now allows a logic loop to ignore magnitude information * removed unncessary comment mapmaker * converted pyflex_presets script into a docs page and removed gatherer docs page from index TOC because gatherer has been nixed * starting to fix tests but many still broken from refactoring * bump version number 0.3.0 because this PR will have backwards incompatible changes removed lingering deps. on PySEP by adding back one formatting function that had been copied over to PySEP * update CHANGELOG with v0.3.0 changes * updating windows documentation for better formatting * remove lingering references to gatherer class * fixed ASDF util tests * fixed wave maker tests * fixed Config tests * changed baseline images for wave maker plot * fixing manager tests * removed 'force' argument from flow and flow_multiband Manager functions, and moved kwargs into args to make things more explicit * overhauled 'flow_multiband' in Manager to mimic behavior of 'flow', which is to return internal attributes 'windows' and 'adjsrcs' which can be used for later misfit assessment previously this function returned dictionaries of dictionaries which needed to be manipulated, now the function averages all adjoint sources from all period bands, and also collects all windows, and puts them in the same format as the expected 'windows' and 'adjsrcs' attributes so that the results of flow multiband can be accessed the same way as the results of 'flow' * all tests passing * small update docs based on recent changes * updates RTD Yaml file to comply with build.image deprecation * attempt fix failing RTD build by swapping Python for Mamba * updates changelog doc file * removed pysep import call in test, Pyatoa no longer relies on PySEP as a dep * trimmed down docs/environment.yml because RTD no longer needs to build notebooks remotely, created new environment_local.yml file for those that need a local conda environment to build docs * fixing some Sphinx errors on docs building * BUGFIX: Pandas>=2.0 changed default value of groupby().mean() such that string only columns were not dropped automatically, needed to set a flag to get this to resume previous behavior, caught by test * removing context manager usage of ASDFDataSet from Manager tests as they were throwing RuntimeErrors in tests * remove one additional ASDF context case from test * lower-case changelog docs page --------- Co-authored-by: Bryant Chow <[email protected]>
1 parent abb9bd4 commit 6eae6c9

Some content is hidden

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

41 files changed

+1225
-2378
lines changed

.readthedocs.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
version: 2
22

3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "mambaforge-22.9"
7+
38
sphinx:
49
builder: html
5-
configuration: ./docs/conf.py
10+
configuration: docs/conf.py
611

712
conda:
8-
environment: ./docs/environment.yml
13+
environment: docs/environment.yml

CHANGELOG.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
11
# CHANGELOG
22

3+
## v0.3.0
4+
5+
>__Note__: The motivation behind the changes in v0.3.0 were that the original
6+
> data gathering setup used by Pyatoa was very abstract, opaque, and
7+
> unncessarily rigid (e.g.,, building path strings out of various components of
8+
> filenames and internal attributes). The new approach to data gathering is to
9+
> use PySEP to perform all data gathering once-and-for-all, including one time
10+
> tasks like instrument removal. The resulting SAC files can then be read in
11+
> with ObsPy and directly fed into the Manager class for misfit quantification.
12+
> This also gives the User much more control over their data gathering without
13+
> getting confused by Pyatoa's internal data gathering system.
14+
15+
- Removed ``pyatoa.core.gatherer.Gatherer`` class from package entirely, all
16+
data gathering capabilities have been migrated to PySEP, Pyatoa will now only
17+
accept input data as already-defined ObsPy objects
18+
- Removed Gatherer-related tests and documentation from package
19+
- Removed ``paths`` attribute from ``pyatoa.core.config.Config`` and all
20+
references to the paths attribute throughout the package as these were only
21+
accessed by the now removed ``Gatherer`` class
22+
- Changed Pyflex and Pyadjoint configuration building procedure in
23+
``pyatoa.core.config.Config`` as it was previously abstracted behind a few
24+
unncessary functions. ``Config`` now accepts parameters ``pyflex_parameters``
25+
and ``pyadjoint_parameters`` (dictionaries) that overwrite default Config
26+
parameters in the underlying Config objects
27+
- Changed ``pyatoa.core.manager.Manager.write()`` to ``write_to_dataset`` to be
28+
clearer in explaning it's role
29+
- Exposed the default preprocessing procedures directly in the
30+
``Manager.preprocess`` function, rather than having it hidden behind a
31+
function call to a utility script. Users who want to overwrite the
32+
preprocessing need only skip the call to preprocess and perform their own
33+
tasks on the internally defined ``st_obs`` and ``st_syn`` attributes.
34+
- Removed ``pyatoa.core.manager.Manager``'s ability to save to ASDFDataSet mid
35+
workflow (i.e., during window and measure). Manager must now use the
36+
``write_to_dataset`` function if it wants to save data to an ASDFDataSet
37+
- Removed the ``pyatoa/plugins`` directory which only contained the pyflex
38+
preset dictionaries. These were not very flexible, instead they have been
39+
converted to a docs page for easier accessibility.
40+
- Created Docs page for Pyflex presets that can be copy-pasted into misfit
41+
quantification routines
42+
- Added a ``plt.close('all')`` to the end of the Manager's plot routine as
43+
as a final precaution against leaving an excessive number of Matplotlib
44+
figures open
45+
- Overhauled ``pyatoa.core.manager.Manager.flow_multiband`` to mimic behavior
46+
the standard behavior of ``Manager.flow``, that is: return internal attributes
47+
``windows`` and ``adjsrcs`` which are component-wise dictionaries that each
48+
contain Pyflex Windows and Pyadjoint AdjointSource objects, respectively.
49+
Previously this function returned dictionaries of dictionaries which needed
50+
to be further manipulated, now the function averages all adjoint sources
51+
from all period bands, and also collects all windows.
52+
- Adjusted and fixed tests based on all the above changes.
53+
54+
## v0.2.2
55+
56+
- Bugfix: Gatherer attempting to access a removed Config parameter
57+
- Resolve PyPDF2 -> PyPDF dependency deprecation warning
58+
- Bugfix: Manager.standardize() only resamples if required, otherwise small time shifting is introduced (Issue \#34)
59+
360
## v0.2.1
461

562
- Updated internal call structures to deal with Pyadjoint v0.2.1 API changes

CONTRIBUTORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Chow, Bryant
2+
Örsvuran, Ridvan

docs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ In order to build the Docs locally, you will first need to create a separate
1313
Conda environment with a few packages, you can do this by running:
1414

1515
``` bash
16-
conda env create --file environment.yaml
16+
conda env create --file environment_local.yml
1717
conda activate pyatoa-docs
1818
```
1919

2020
You can then run the make command to generate the .html files. You can find your
2121
local docs in the *_build/html* directory
2222

23+
Note that the file ``environment.yml`` is used for building docs on ReadTheDocs,
24+
but does not contain all required dependencies to build locally.
25+
2326
```bash
2427
make html
2528
```

docs/changelog.rst

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,85 @@
1-
Change Log
2-
==============
3-
4-
Version 0.2.0
5-
~~~~~~~~~~~~~~~
1+
Changelog
2+
=========
3+
4+
v0.3.0
5+
------
6+
7+
**Note**: The motivation behind the changes in v0.3.0 were that the
8+
original data gathering setup used by Pyatoa was very abstract,
9+
opaque, and unncessarily rigid (e.g.,, building path strings out of
10+
various components of filenames and internal attributes). The new
11+
approach to data gathering is to use PySEP to perform all data
12+
gathering once-and-for-all, including one time tasks like instrument
13+
removal. The resulting SAC files can then be read in with ObsPy and
14+
directly fed into the Manager class for misfit quantification. This
15+
also gives the User much more control over their data gathering
16+
without getting confused by Pyatoa’s internal data gathering system.
17+
18+
- Removed ``pyatoa.core.gatherer.Gatherer`` class from package
19+
entirely, all data gathering capabilities have been migrated to
20+
PySEP, Pyatoa will now only accept input data as already-defined
21+
ObsPy objects
22+
- Removed Gatherer-related tests and documentation from package
23+
- Removed ``paths`` attribute from ``pyatoa.core.config.Config`` and
24+
all references to the paths attribute throughout the package as these
25+
were only accessed by the now removed ``Gatherer`` class
26+
- Changed Pyflex and Pyadjoint configuration building procedure in
27+
``pyatoa.core.config.Config`` as it was previously abstracted behind
28+
a few unncessary functions. ``Config`` now accepts parameters
29+
``pyflex_parameters`` and ``pyadjoint_parameters`` (dictionaries)
30+
that overwrite default Config parameters in the underlying Config
31+
objects
32+
- Changed ``pyatoa.core.manager.Manager.write()`` to
33+
``write_to_dataset`` to be clearer in explaning it’s role
34+
- Exposed the default preprocessing procedures directly in the
35+
``Manager.preprocess`` function, rather than having it hidden behind
36+
a function call to a utility script. Users who want to overwrite the
37+
preprocessing need only skip the call to preprocess and perform their
38+
own tasks on the internally defined ``st_obs`` and ``st_syn``
39+
attributes.
40+
- Removed ``pyatoa.core.manager.Manager``\ ’s ability to save to
41+
ASDFDataSet mid workflow (i.e., during window and measure). Manager
42+
must now use the ``write_to_dataset`` function if it wants to save
43+
data to an ASDFDataSet
44+
- Removed the ``pyatoa/plugins`` directory which only contained the
45+
pyflex preset dictionaries. These were not very flexible, instead
46+
they have been converted to a docs page for easier accessibility.
47+
- Created Docs page for Pyflex presets that can be copy-pasted into
48+
misfit quantification routines
49+
- Added a ``plt.close('all')`` to the end of the Manager’s plot routine
50+
as as a final precaution against leaving an excessive number of
51+
Matplotlib figures open
52+
- Overhauled ``pyatoa.core.manager.Manager.flow_multiband`` to mimic
53+
behavior the standard behavior of ``Manager.flow``, that is: return
54+
internal attributes ``windows`` and ``adjsrcs`` which are
55+
component-wise dictionaries that each contain Pyflex Windows and
56+
Pyadjoint AdjointSource objects, respectively. Previously this
57+
function returned dictionaries of dictionaries which needed to be
58+
further manipulated, now the function averages all adjoint sources
59+
from all period bands, and also collects all windows.
60+
- Adjusted and fixed tests based on all the above changes.
61+
62+
v0.2.2
63+
------
64+
65+
- Bugfix: Gatherer attempting to access a removed Config parameter
66+
- Resolve PyPDF2 -> PyPDF dependency deprecation warning
67+
- Bugfix: Manager.standardize() only resamples if required, otherwise
68+
small time shifting is introduced (Issue #34)
69+
70+
v0.2.1
71+
------
72+
73+
- Updated internal call structures to deal with Pyadjoint v0.2.1 API
74+
changes
75+
- Changed internal test ASDFDataSet and created a script to generate
76+
new dataset because the old one had no way of being remade.
77+
- New Docs + Example + Example data: Processing data with Pyatoa and
78+
MPI
79+
- Remove GitHub Pip install links for PySEP, Pyflex and Pyadjoint
80+
81+
v0.2.0
82+
------
683
- Renamed 'Quickstart' doc to 'A short example', created a new 'Quickstart' doc which has a short code snippet that creates a figure.
784

885
- Revamped documentation, switched to new style of building documentation using only .rst files (rather than building off of Jupyter notebooks directly in RTD, which was high in memory consumption)

docs/conf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@
2525
author = 'adjTomo Dev Team'
2626

2727
# The short X.Y version
28-
version = '0.2.2'
28+
# Grab version number from 'pyproject.toml'
29+
with open("../pyproject.toml", "r") as f:
30+
_lines = f.readlines()
31+
for _line in _lines:
32+
if _line.startswith("version"):
33+
version = _line.split('"')[1].strip()
34+
2935
# The full version, including alpha/beta/rc tags
3036
release = ''
3137

@@ -75,7 +81,7 @@
7581
#
7682
# This is also used if you do content translation via gettext catalogs.
7783
# Usually you set "language" from the command line for these cases.
78-
language = None
84+
language = "en"
7985

8086
# List of patterns, relative to source directory, that match files and
8187
# directories to ignore when looking for source files.

0 commit comments

Comments
 (0)