Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
.idea/
__pycache__
version
# Only ignore results and models directories within tutorial case folders
tutorials/case*/results/
tutorials/case*/models/
tutorials/case*/pymock*
tutorials/case*/*.json
tutorials/case*/**/*.csv
tests/artifacts/models/
tests/artifacts/catalogs/
tests/artifacts/zenodo/
tests/artifacts/zenodo_test/
notes.kg

# Next.js
floatcsep/postprocess/nextjs/.next/
floatcsep/postprocess/nextjs/node_modules/
floatcsep/postprocess/nextjs/out/
floatcsep/postprocess/nextjs/.vercel/
floatcsep/postprocess/nextjs/coverage/
floatcsep/postprocess/nextjs/.cache/
floatcsep/postprocess/nextjs/.env*.local
floatcsep/postprocess/nextjs/package-lock.json

# General Node.js
node_modules/
package-lock.json
28 changes: 28 additions & 0 deletions docs/guide/executing_experiment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The `<command>` can be one of the following:
- `run`: Run the experiment.
- `stage`: Prepare the environment and models.
- `plot`: Plot forecasts, catalogs, and results.
- `view`: Launch an interactive web dashboard to explore results.
- `reproduce`: (see folllowing\ section) Reproduce the results of a previously run experiment.

Each command requires a configuration file (in `YAML` format), which defines the parameters of the experiment.
Expand Down Expand Up @@ -97,6 +98,33 @@ The `plot` command re-loads the experiment configuration, stages the models, ide
This command can be useful when trying to customize plots or reports after the results have been created.


Viewing Results Interactively: ``floatcsep view``
-------------------------------------------------

The `view` command launches an interactive web dashboard to explore the experiment results in a browser:

.. code-block:: console

$ floatcsep view <config.yml> --ui nextjs

Or using the Panel-based dashboard:

.. code-block:: console

$ floatcsep view <config.yml>

This starts a local server and opens a browser at ``http://localhost:<port>`` where you can:

- View the experiment overview and configuration
- Browse forecast visualizations
- Explore catalog plots
- Review evaluation results (N-test, S-test plots)

.. note::

The ``--ui nextjs`` option (recommended) uses a modern Next.js-based interface. Node.js 18.17.0 or newer is required (automatically downloaded if not present). The ``--ui panel`` option uses the Panel-based dashboard.


Reproducing Results: ``floatcsep reproduce``
--------------------------------------------

Expand Down
2 changes: 2 additions & 0 deletions docs/guide/experiment_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ Configuring the spatial and magnitude definitions is done through the ``region_c
- The minimum depth (in `km`) of the experiment.
* - **depth_max**
- The maximum depth (in `km`) of the experiment.
* - **strict_region**
- If ``true``, spatial tests (S-test, L-test) will fail when the forecast region differs from the experiment region. If ``false`` (default), the catalog is automatically filtered to the forecast region with a warning.


1. The ``region`` parameter can be defined from:
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_a.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The following example shows the definition of a testing experiment of a single *
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


.. contents:: Contents
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_b.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The following example is an experiment including **multiple** time-independent f
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


.. contents:: Contents
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The following example shows an experiment with **multiple time windows**.
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


.. contents:: Contents
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The following example shows an experiment whose forecasts are **retrieved from a
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


.. contents:: Contents
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_e.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This example shows how to run a realistic testing experiment (based on :ref:`Sch
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


.. contents:: Contents
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_f.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ This example shows how set up an experiment with a **time-dependent** model, who
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


.. contents:: Contents
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_g.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Here, we set up a time-dependent model from its **source code** for an experimen
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


For troubleshooting, run the experiment with:
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Here, we run an experiment that accesses, containerizes and executes multiple **
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


For troubleshooting, run the experiment with:
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_i.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ This case uses simple mock models as examples.
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


For troubleshooting, run the experiment with:
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/case_j.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ producing daily gridded forecasts and evaluating them with a Poisson N-test. The
.. code-block:: console

$ floatcsep view config.yml
$ floatcsep view config.yml --ui nextjs # Alternative: modern Next.js dashboard


For troubleshooting, run the experiment with:
Expand Down
174 changes: 174 additions & 0 deletions floatcsep.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
Metadata-Version: 2.4
Name: floatcsep
Version: 0.0.0.post455
Summary: CSEP Floating Experiment application
Author-email: Pablo Iturrieta <pciturri@gfz-potsdam.de>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://github.com/cseptesting/floatcsep.git
Keywords: earthquake,forecasting,seismology,CSEP
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: <3.13,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: dateparser
Requires-Dist: docker
Requires-Dist: gitpython
Requires-Dist: h5py
Requires-Dist: matplotlib
Requires-Dist: pandas
Requires-Dist: panel
Requires-Dist: packaging
Requires-Dist: pycsep
Requires-Dist: pyyaml
Requires-Dist: requests
Requires-Dist: scipy
Requires-Dist: seaborn
Requires-Dist: tables
Requires-Dist: xmltodict
Requires-Dist: weasyprint
Requires-Dist: markdown-it-py
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-autoapi; extra == "dev"
Requires-Dist: sphinx_design; extra == "dev"
Requires-Dist: sphinx-toolbox; extra == "dev"
Requires-Dist: sphinx-gallery; extra == "dev"
Requires-Dist: sphinx-rtd-theme; extra == "dev"
Requires-Dist: sphinx_copybutton; extra == "dev"
Requires-Dist: vcrpy; extra == "dev"
Dynamic: license-file

# CSEP Floating Experiments

<img src="https://i.postimg.cc/6p5krRnB/float-CSEP-Logo-CMYK.png" width="320">

**An application to deploy reproducible and prospective experiments of earthquake forecasting**

<p left>

[![Documentation Status](https://readthedocs.org/projects/floatcsep/badge/?version=latest)](https://floatcsep.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://github.com/cseptesting/floatcsep/actions/workflows/build-test.yml/badge.svg)](https://github.com/cseptesting/floatcsep/actions/workflows/build-test.yml)
[![PyPI Version](https://img.shields.io/pypi/v/floatcsep)](https://pypi.org/project/floatcsep/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/floatcsep)](https://anaconda.org/conda-forge/floatcsep)
[![Python Versions](https://img.shields.io/pypi/pyversions/floatcsep)](https://pypi.org/project/floatcsep/)
[![Code Coverage](https://codecov.io/gh/cseptesting/floatcsep/branch/main/graph/badge.svg?token=LI4RSDOKA1)](https://codecov.io/gh/cseptesting/floatcsep)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7953816.svg)](https://doi.org/10.5281/zenodo.7953816)


</p>

* Set up a testing **experiment** for your earthquake forecasts using authoritative data sources
and benchmarks.
* **Encapsulate** the complete experiment's definition and rules in a couple of lines.
* **Reproduce**, **reuse**, and **share** forecasting experiments from you, other researchers
and institutions.

# Table of Contents

* [Installation](#installing-floatcsep)
* [Documentation](https://floatcsep.readthedocs.io)
* [Run and explore](#run-an-experiment)
* [Useful Links](#important-links)
* [Roadmap/Issues](#roadmap-and-known-issues)
* [Contributing](#contributing)
* [License](#license)

# Installing floatCSEP

The core of `floatCSEP` is built around the `pyCSEP`
package (https://github.com/sceccode/pycsep), which itself contains the core dependencies.

## Latest version

Clone and install the floatCSEP source code using `pip`

```
conda create -n $NAME -y python=3.12
conda activate $NAME
git clone https://github.com/cseptesting/floatcsep
cd floatcsep
pip install -e .
```

## Stable Release

The simplest way to install `floatCSEP` is by creating a `conda`
environment (https://conda.io - checkout Anaconda or Miniforge) and install `floatCSEP`
from `conda-forge`

```
conda create -n $NAME -y python=3.12
conda activate $NAME
conda install -c conda-forge floatcsep -y
```

Please read
the [Installation](https://floatcsep.readthedocs.io/en/latest/intro/installation.html)
documentation for detailed instructions and additional installation methods.

# Run an Experiment

Using the command terminal, navigate to an example experiment in ``floatcsep/tutorials/`` and
type

```
floatcsep run config.yml
```

A runtime directory will be created in a `results` folder. The experiment results can be
visualized in `results/report.md` or `results/report.pdf`. **Check out the experiment, models and tests definition in
the tutorials**!

# Important Links

* [Documentation](https://floatcsep.readthedocs.io/en/latest/)
* [CSEP Website](https://cseptesting.org)
* `pyCSEP` [Github](https://github.com/sceccode/pycsep)
* `pyCSEP` [Documentation](https://docs.cseptesting.org/)

# Roadmap and Known Issues

* Create tool to check a TD model's interface with ``floatcsep``
* Define a dependency strategy to ensure experiments' reproducibility (e.g., storing docker image).
* Implement spatial database and HDF5 experiment storage feature
* Set up task parallelization
* Document the process of an experiment deployment

# Contributing

We encourage all types of contributions, from reporting bugs, suggesting enhancements, adding
new features and more. Please refer to
the [Contribution Guidelines](https://github.com/cseptesting/floatcsep/blob/main/CONTRIBUTING.md)
and the [Code of Conduct](https://github.com/cseptesting/floatcsep/blob/main/CODE_OF_CONDUCT.md)
for more information

# License

The `floatCSEP` (as well as `pyCSEP`) software is distributed under the BSD 3-Clause open-source
license. Please see
the [license file](https://github.com/cseptesting/floatcsep/blob/main/LICENSE) for more
information.

## Support

| <img src="https://i.postimg.cc/rFKQ0vRL/GFZ-Wortbildmarke-EN-Helmholtzdunkelblau-RGB.png" alt="GFZ logo" height="50"/> | <img src="https://i.postimg.cc/CLc5tQcZ/Geo-INQUIRE-logo.png" alt="GeoInquire logo" height="72"/> | <img src="https://i.postimg.cc/tC1LdjYf/scec.png" alt="SCEC logo" height="90"/> |
|:----------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------:|


- The work in this repository has received funding from the European Union’s Horizon research and innovation programme
under grant agreements No.s 101058518 and 821115 of the projects [GeoInquire](https://www.geo-inquire.eu/) and [RISE](https://www.rise-eu.org/).

- This research was supported by the [Statewide California Earthquake Center](https://www.scec.org/).
SCEC is funded by NSF Cooperative Agreement EAR-2225216 and USGS Cooperative Agreement G24AC00072-00.



Loading