Skip to content

Commit cc01742

Browse files
committed
Merge branch 'dev' into 'main'
major refactoring See merge request csep-group/fecsep!1
2 parents 8d92bd6 + d35275b commit cc01742

Some content is hidden

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

67 files changed

+1354918
-80
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
__pycache__
3+

README.md

Lines changed: 20 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,32 @@
1-
# Floating Experiment - CSEP
1+
# CSEP Floating Experiments - `fecsep`
22

3+
## Table of Contents
34

5+
* [Installing computational environment](installing-computational-environment)
6+
* [Run experiment](run-experiment)
47

5-
## Getting started
68

7-
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8-
9-
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10-
11-
## Add your files
12-
13-
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14-
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
9+
## Installing computational environment
1510

1611
```
17-
cd existing_repo
18-
git remote add origin https://git.gfz-potsdam.de/csep-group/fecsep.git
19-
git branch -M main
20-
git push -uf origin main
12+
conda env create -f environment.yml
13+
conda activate fecsep
14+
pip install -e .
2115
```
2216

23-
## Integrate with your tools
24-
25-
- [ ] [Set up project integrations](https://git.gfz-potsdam.de/csep-group/fecsep/-/settings/integrations)
26-
27-
## Collaborate with your team
28-
29-
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30-
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33-
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34-
35-
## Test and Deploy
36-
37-
Use the built-in continuous integration in GitLab.
38-
39-
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40-
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41-
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42-
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43-
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44-
45-
***
46-
47-
# Editing this README
48-
49-
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
50-
51-
## Suggestions for a good README
52-
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
53-
54-
## Name
55-
Choose a self-explaining name for your project.
17+
Installs pyCSEP and other dependencies to run the experiment. See `environment.yml` file for details.
5618

57-
## Description
58-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
59-
60-
## Badges
61-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
62-
63-
## Visuals
64-
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
65-
66-
## Installation
67-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
68-
69-
## Usage
70-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
71-
72-
## Support
73-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
74-
75-
## Roadmap
76-
If you have ideas for releases in the future, it is a good idea to list them in the README.
77-
78-
## Contributing
79-
State if you are open to contributions and what your requirements are for accepting them.
80-
81-
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
82-
83-
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
19+
## Run experiment
20+
Access the experiment directory
21+
```
22+
fecsep run <config>
23+
```
24+
Usage:
25+
```
26+
config (required) : path to config.yml file
8427
85-
## Authors and acknowledgment
86-
Show your appreciation to those who have contributed to the project.
28+
```
8729

88-
## License
89-
For open source projects, say how it is licensed.
30+
A runtime directory will be created in the `results` folder with the test date as the name. The results from this
31+
run of the experiment are contained in `readme.md`.
9032

91-
## Project status
92-
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

docs/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = fecsep
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
livehtml:
16+
sphinx-autobuild -b html $(SOURCEDIR) $(ALLSPHINXOPTS) $(BUILDDIR)/html
17+
18+
clean:
19+
rm -rf $(BUILDDIR)/*
20+
rm -rf auto_examples/
21+
22+
.PHONY: help Makefile
23+
24+
# Catch-all target: route all unknown targets to Sphinx using the new
25+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
26+
%: Makefile
27+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/CSEP2_Logo_CMYK.png

80.7 KB
Loading

docs/conf.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
import os
6+
import sys
7+
8+
sys.path.insert(0, os.path.abspath('..'))
9+
10+
# -- Project information -----------------------------------------------------
11+
12+
project = 'feCSEP'
13+
copyright = '2022, Pablo Iturrieta'
14+
author = 'Pablo Iturrieta'
15+
release = 'v0.1.0'
16+
17+
# -- General configuration ---------------------------------------------------
18+
19+
extensions = [
20+
'sphinx.ext.autodoc',
21+
'sphinx.ext.todo',
22+
'sphinx.ext.autosummary',
23+
'sphinx.ext.coverage',
24+
'sphinx.ext.mathjax',
25+
'sphinx.ext.viewcode',
26+
'sphinx.ext.napoleon',
27+
'sphinx.ext.intersphinx',
28+
# 'sphinx_gallery.gen_gallery', # todo
29+
# 'sphinx.ext.githubpages'
30+
]
31+
32+
templates_path = ['_templates']
33+
source_suffix = '.rst'
34+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
35+
pygments_style = 'default' # todo
36+
37+
intersphinx_mapping = {
38+
"python": ("https://docs.python.org/3/", None),
39+
"numpy": ("https://docs.scipy.org/doc/numpy/", None),
40+
"pandas": ("http://pandas.pydata.org/pandas-docs/stable/", None),
41+
"scipy": ('http://docs.scipy.org/doc/scipy/reference', None),
42+
"matplotlib": ('http://matplotlib.sourceforge.net/', None),
43+
'pycsep': ('https://docs.cseptesting.org/', None)
44+
}
45+
# -- Options for HTML output -------------------------------------------------
46+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
47+
48+
html_theme = 'sphinx_rtd_theme'
49+
html_static_path = ['_static']
50+
51+
todo_include_todos = False

docs/index.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. feCSEP documentation master file, created by
2+
sphinx-quickstart on Wed Nov 16 09:56:55 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
feCSEP: Floating Experiments
7+
============================
8+
9+
Preliminary documentation. Includes only the API reference
10+
11+
.. toctree::
12+
:maxdepth: 2
13+
:caption: Contents:
14+
15+
16+
.. toctree::
17+
:maxdepth: 2
18+
:hidden:
19+
:caption: Help & Reference
20+
21+
reference/api_reference
22+
23+
24+
25+
Indices and tables
26+
==================
27+
28+
* :ref:`genindex`
29+
* :ref:`modindex`
30+
* :ref:`search`

docs/reference/api_reference.rst

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
API Reference
2+
=============
3+
4+
This contains a reference document to the feCSEP API.
5+
6+
7+
Experiment
8+
----------
9+
10+
.. :currentmodule:: fecsep.core
11+
12+
.. automodule:: fecsep.core
13+
14+
15+
The experiment is defined using the :class:`Experiment` class.
16+
17+
.. autosummary::
18+
:toctree: generated
19+
20+
Experiment
21+
Experiment.set_models
22+
Experiment.set_tests
23+
Experiment.prepare_paths
24+
Experiment.prepare_tasks
25+
Experiment.run
26+
Experiment.plot_results
27+
Experiment.plot_forecasts
28+
Experiment.generate_report
29+
Experiment.from_yml
30+
Experiment.to_dict
31+
Experiment.to_yml
32+
33+
34+
Model
35+
-----
36+
37+
38+
A model is defined using the :class:`Model` class.
39+
40+
.. autosummary::
41+
:toctree: generated
42+
43+
Model
44+
Model.get_source
45+
Model.make_db
46+
Model.rm_db
47+
Model.create_forecast
48+
Model.make_forecast_td
49+
Model.make_forecast_ti
50+
Model.to_dict
51+
Model.from_dict
52+
53+
54+
Test
55+
----
56+
57+
58+
A test is defined using the :class:`Test` class.
59+
60+
.. autosummary::
61+
:toctree: generated
62+
63+
Test
64+
Test.compute
65+
Test.to_dict
66+
Test.from_dict
67+
68+
69+
70+
71+
Running an Experiment
72+
----------------------
73+
74+
.. :currentmodule:: fecsep.main
75+
76+
.. automodule:: fecsep.main
77+
78+
.. autosummary::
79+
:toctree: generated
80+
81+
run
82+
plot
83+
84+
85+
Accessors
86+
---------
87+
88+
.. :currentmodule:: fecsep.accessors
89+
90+
.. automodule:: fecsep.accessors
91+
92+
.. autosummary::
93+
:toctree: generated
94+
95+
query_isc_gcmt
96+
from_zenodo
97+
from_git
98+
99+
100+
Utilities
101+
---------
102+
103+
.. :currentmodule:: fecsep.utils
104+
105+
.. automodule:: fecsep.utils
106+
107+
.. autosummary::
108+
:toctree: generated
109+
110+
parse_csep_func
111+
parse_timedelta_string
112+
read_time_config
113+
read_region_config
114+
time_windows_ti
115+
time_windows_td
116+
Task
117+
Task.run
118+
Task.check_exist
119+
timewindow_str
120+
sequential_likelihood
121+
plot_sequential_likelihood
122+
magnitude_vs_time
123+
124+
125+
126+
Database parsers
127+
----------------
128+
129+
.. :currentmodule:: fecsep.dbparser
130+
131+
.. automodule:: fecsep.dbparser
132+
133+
.. autosummary::
134+
:toctree: generated
135+
136+
HDF5Serializer.quadtree
137+
HDF5Serializer.dat
138+
HDF5Serializer.csv
139+
HDF5Serializer.xml
140+
load_from_hdf5
141+
142+

environment.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: fecsep
2+
channels:
3+
- conda-forge
4+
- defaults
5+
dependencies:
6+
- python=3.9
7+
- pycsep=0.6.0
8+
- cartopy=0.20.2
9+
- geos=3.10.2
10+
- matplotlib-base=3.5.1
11+
- mercantile=1.2.1
12+
- numpy=1.21.5
13+
- obspy=1.2.2
14+
- pandas=1.4.1
15+
- pyproj=3.3.0
16+
- pyshp=2.2.0
17+
- scipy=1.8.0
18+
- shapely=1.8.0
19+
- pyyaml
20+
- docker-py
21+
- h5py
22+
- pytables
23+
- gitpython=3.1.27
24+
- dateparser
25+
- vcrpy
26+
- xmltodict

fecsep/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)