Difference between revisions of "FloatCSEP"

From SCECpedia
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
== Interpretting yml files ==
 
== Interpretting yml files ==
syntax may not be consistent, with mix of colon:
+
 
 +
The file paths are relative to the config.yml file
 
attr_name: attr_value
 
attr_name: attr_value
 
and colon: dash then attr_name: attr_value
 
and colon: dash then attr_name: attr_value
The file paths are relative to the config.yml file
 
 
The valid module names are not clear
 
The valid module names are not clear
 
the valid cmap is not clear
 
the valid cmap is not clear
 
No indication that the attri catalog: the value is boolean True
 
No indication that the attri catalog: the value is boolean True
 +
 
<pre>
 
<pre>
 
Models:
 
Models:
Line 29: Line 30:
 
  introduces wheel as a model
 
  introduces wheel as a model
 
* case_e
 
* case_e
The impact of the plot command not obvious.
+
The impact of the plot command not obvious. Seems to replace cmap: magma with colormap:magma, which may mean the same thing.
Seems to replace cmap: magma with colormap:magma
+
* case_f
 +
Error when replacing the catalog: geonet_catalog statement as described in the docs....
 +
<pre>
 +
Traceback (most recent call last):
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/bin/floatcsep", line 8, in <module>
 +
    sys.exit(floatcsep())
 +
            ^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 224, in floatcsep
 +
    func(**vars(args))
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 79, in run
 +
    exp = Experiment.from_yml(config_yml=config, **kwargs)
 +
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/experiment.py", line 690, in from_yml
 +
    return cls(**_dict, **kwargs)
 +
          ^^^^^^^^^^^^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/experiment.py", line 160, in __init__
 +
    self.catalog_repo.set_main_catalog(catalog, self.time_config, self.region_config)
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/infrastructure/repositories.py", line 368, in set_main_catalog
 +
    self.catalog = catalog
 +
    ^^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/infrastructure/repositories.py", line 429, in catalog
 +
    self._catalog = parse_csep_func(cat)
 +
                    ^^^^^^^^^^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/utils/helpers.py", line 85, in parse_csep_func
 +
    raise AttributeError(
 +
AttributeError: Evaluation/Plot/Region function query_geonet has not yet been implemented in floatcsep or pycsep
 +
(csep_env) maechlin@Philip-James-MacBook case_f %
 +
 
 +
</pre>
 +
* case_f
 +
How does floatCSEP determine the number of tasks e.g. below
 +
<pre>
 +
2024-10-21 15:51:40 INFO - Setting up experiment's tasks
 +
2024-10-21 15:51:40 INFO - Running 16 tasks
 +
</pre>
 +
 
 +
*case_g
 +
replaced models.yml build: venv with build: docker and it still runs...
 +
shutdown docker on laptop, and run again, and still runs..."Dockermanager"
  
== read the docs links for floatCSEP ==
+
*case_h
 +
Put dependencies on model developers to ensure they provide an environment.yml file in the root of the gitrepo. This is used to build the
 +
<pre>
 +
2024-10-21 16:33:21 INFO - [Negbinom_Mock]: Total of 806 events M>4.0 in 100 synthetic catalogs
 +
2024-10-21 16:33:23 INFO - Calculation completed
 +
2024-10-21 16:33:23 INFO - Plotting forecasts
 +
Traceback (most recent call last):
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/bin/floatcsep", line 8, in <module>
 +
    sys.exit(floatcsep())
 +
            ^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 224, in floatcsep
 +
    func(**vars(args))
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 85, in run
 +
    plot_forecasts(experiment=exp)
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/postprocess/plot_handler.py", line 91, in plot_forecasts
 +
    ax = model.get_forecast(window, experiment.region).plot(
 +
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/csep/core/forecasts.py", line 716, in plot
 +
    self.get_expected_rates(verbose=verbose)
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/csep/core/forecasts.py", line 696, in get_expected_rates
 +
    gridded_counts = cat.spatial_magnitude_counts()
 +
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/csep/core/catalogs.py", line 771, in spatial_magnitude_counts
 +
    raise ValueError("at least one magnitude value outside of the valid region.")
 +
ValueError: at least one magnitude value outside of the valid region.
 +
</pre>
 +
== Read the docs links for floatCSEP ==
 
*[https://floatcsep.readthedocs.io/en/latest/ floatCSEP Tutorial]
 
*[https://floatcsep.readthedocs.io/en/latest/ floatCSEP Tutorial]
  
== Mac Hardward ==
+
== Mac Test Hardware ==
 
*Macbook pro Quad-core Intel i5
 
*Macbook pro Quad-core Intel i5
 
*Sonoma 14.7
 
*Sonoma 14.7

Latest revision as of 00:21, 22 October 2024

Testing of latest floatCSEP tutorials...


Interpretting yml files

The file paths are relative to the config.yml file attr_name: attr_value and colon: dash then attr_name: attr_value The valid module names are not clear the valid cmap is not clear No indication that the attri catalog: the value is boolean True

Models:
  -best_model:
       path: best_model.dat

Test Cases

  • case_a

The rules for specifying a test module name seem to be give the

      func: poisson_evaluations.number_test
      plot_func: plot_poisson_consistency_test
  • case_b
  • case_c
  • case_d
introduces wheel as a model
  • case_e

The impact of the plot command not obvious. Seems to replace cmap: magma with colormap:magma, which may mean the same thing.

  • case_f

Error when replacing the catalog: geonet_catalog statement as described in the docs....

Traceback (most recent call last):
  File "/Users/maechlin/anaconda3/envs/csep_env/bin/floatcsep", line 8, in <module>
    sys.exit(floatcsep())
             ^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 224, in floatcsep
    func(**vars(args))
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 79, in run
    exp = Experiment.from_yml(config_yml=config, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/experiment.py", line 690, in from_yml
    return cls(**_dict, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/experiment.py", line 160, in __init__
    self.catalog_repo.set_main_catalog(catalog, self.time_config, self.region_config)
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/infrastructure/repositories.py", line 368, in set_main_catalog
    self.catalog = catalog
    ^^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/infrastructure/repositories.py", line 429, in catalog
    self._catalog = parse_csep_func(cat)
                    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/utils/helpers.py", line 85, in parse_csep_func
    raise AttributeError(
AttributeError: Evaluation/Plot/Region function query_geonet has not yet been implemented in floatcsep or pycsep
(csep_env) maechlin@Philip-James-MacBook case_f % 

  • case_f

How does floatCSEP determine the number of tasks e.g. below

2024-10-21 15:51:40 INFO - Setting up experiment's tasks
2024-10-21 15:51:40 INFO - Running 16 tasks
  • case_g

replaced models.yml build: venv with build: docker and it still runs... shutdown docker on laptop, and run again, and still runs..."Dockermanager"

  • case_h

Put dependencies on model developers to ensure they provide an environment.yml file in the root of the gitrepo. This is used to build the

2024-10-21 16:33:21 INFO - [Negbinom_Mock]: Total of 806 events M>4.0 in 100 synthetic catalogs
2024-10-21 16:33:23 INFO - Calculation completed
2024-10-21 16:33:23 INFO - Plotting forecasts
Traceback (most recent call last):
  File "/Users/maechlin/anaconda3/envs/csep_env/bin/floatcsep", line 8, in <module>
    sys.exit(floatcsep())
             ^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 224, in floatcsep
    func(**vars(args))
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/commands/main.py", line 85, in run
    plot_forecasts(experiment=exp)
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/floatcsep/postprocess/plot_handler.py", line 91, in plot_forecasts
    ax = model.get_forecast(window, experiment.region).plot(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/csep/core/forecasts.py", line 716, in plot
    self.get_expected_rates(verbose=verbose)
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/csep/core/forecasts.py", line 696, in get_expected_rates
    gridded_counts = cat.spatial_magnitude_counts()
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/maechlin/anaconda3/envs/csep_env/lib/python3.11/site-packages/csep/core/catalogs.py", line 771, in spatial_magnitude_counts
    raise ValueError("at least one magnitude value outside of the valid region.")
ValueError: at least one magnitude value outside of the valid region.

Read the docs links for floatCSEP

Mac Test Hardware

  • Macbook pro Quad-core Intel i5
  • Sonoma 14.7

Conda environment on Mac

/Users/maechlin/dev
$ conda info
     active environment : base
    active env location : /Users/maechlin/anaconda3
            shell level : 1
       user config file : /Users/maechlin/.condarc
 populated config files : /Users/maechlin/.condarc
          conda version : 23.5.0
    conda-build version : 3.18.11
         python version : 3.8.15.final.0

$ conda list

  • pycsep 0.6.2 pyhd8ed1ab_0 conda-forge

Update to conda environment command:

      copying obspy/signal/tests/data/tiny_quality_file.mseed -> build/lib.macosx-10.13-x86_64-cpython-311/obspy/signal/tests/data
      copying obspy/signal/tests/data/unknown.resp -> build/lib.macosx-10.13-x86_64-cpython-311/obspy/signal/tests/data
      creating build/lib.macosx-10.13-x86_64-cpython-311/obspy/signal/tests/data/segfaulting_RESPs
      copying obspy/signal/tests/data/segfaulting_RESPs/RESP.IE.LLRI..EHZ -> build/lib.macosx-10.13-x86_64-cpython-311/obspy/signal/tests/data/segfaulting_RESPs
      running build_ext
      building 'gcf' extension
      creating build/temp.macosx-10.13-x86_64-cpython-311/obspy/io/gcf/src
      clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/maechlin/anaconda3/envs/csep_env/include -fPIC -O2 -isystem /Users/maechlin/anaconda3/envs/csep_env/include -I/Users/maechlin/anaconda3/envs/csep_env/include/python3.11 -c obspy/io/gcf/src/gcf_io.c -o build/temp.macosx-10.13-x86_64-cpython-311/obspy/io/gcf/src/gcf_io.o
      xcode-select: note: No developer tools were found, requesting install.
      If developer tools are located at a non-default location on disk, use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, and cancel the installation dialog.
      See `man xcode-select` for more details.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for obspy
Successfully built floatcsep pycsep
Failed to build obspy
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (obspy)

Try install of clang on Mac

  • xcode-select --install

Brings up a install window on Mac desktop with 5 minute install

  • Exit environment
  • New terminal window
  • conda activity csep_env
  • cd dev/floatcsep
  • pip install .

Complete build no errors

Related Entries