-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SourceSpec v2 #53
Comments
Hi Claudio, I made a first attempt to refactor some functions (in ssp_setup.py, ssp_read_traces.py and source_spec.py) in order to make it possible to run sourcespec as a function. Should I create a new branch for this? |
OK, I created a new branch called v2_ssp_func, but now I get a strange error trying to push it to my github fork: |
Hi Kris, maybe the solution is here : https://stackoverflow.com/questions/64059610/how-to-resolve-refusing-to-allow-an-oauth-app-to-create-or-update-workflow-on |
I have been able to solve it by changing the repository URL in sourcetree, as mentioned here |
I'm able to run sourcespec2 in a jupyter notebook and without writing anything to disk with the modifications I made!
There is room for further improvements/streamlining, but I think we are on the right track. |
Thanks, Kris, for the example! Here's my comment:
I would like to bring the options into the For the CLI usage, the options should be used to override the config parameters: it should be possible to run SourceSpec without any option, and have everything in the config file.
Ok, I will put it into
Ok, I will fix it in
Noted 😉
Noted 😉
Great! |
This two points are fixed in this commit: 87ce4f4 |
Claudio, I tested my notebook after the new rebase, and almost everything still works, except:
Based on an issue with the main branch that I experienced yesterday, I realized that we also need to have a function to clean up state at the end of each run (or probably better at the beginning), so that no problems occur when
I haven't checked yet if this still works in v2, but I guess you know this better than me. |
Ok, thanks for the feedback! Whenever you have time, that would be great if you can contribute this |
SourceSpec v2
This issue is for discussing the development of SourceSpec v2.
The development takes place in the v2 branch.
The main objectives of this major release concern three areas:
sourcespec
with subcommandsCode improvements
config
object, making thus unnecessary to passconfig
as a function parameter. This has been implemented through these commitsssp_
prefix.data_types.py
file, exposing many data types classes)__init__.py
, only the public functions and classes that are used by other submodules. An example is the current implementation ofconfig/__init__.py
main.py
in the main directorysubcommands
submodule (subdirectory). E.g.,subcommands/spectral_inversion.py
,subcommands/direct_modelling.py
,subcommands/source_residuals.py
config
object (see below):copyright: 2018-2024 The SourceSpec Developers
Single executable
We will provide a single executable, called
sourcespec
with subcommands.Here's a mockup of invoking
sourcespec -h
:The old commands (
source_spec
,source_model
,source_residual
, etc.) will still exist in v2.0 and will print an error message when invoked. They will be removed in v2.1.Python API
Here's some ideas from @krisvanneste, which I reworked:
Reorganize configuration
We will reorganize configuration into sections, reflecting the submodules structures. The new config file should look like the following (comments removed here for simplicity):
The parameters will be accessible from the
config
object, as in the following examples:How to test SourceSpec v2
The easiest way is to clone the git repository to a new directory, called
sourcespec2
, then immediately switch to thev2
branch:In the
v2
branch, the package name has been temporary renamed tosourcespec2
so that it can be installed alongside the current version. For installing, go to thesourcespec2
directory and run:This will install the
sourcespec2
package and the command line utils, currently namedsource_spec2
,source_model2
, etc.Keeping the branch up-to-date
The
v2
branch is frequently rebased, so make sure to do agit pull --force
Contributing to SourceSpec v2
Contributions are always more than welcome!
Just make sure to create your development branch from the
v2
branch and to make your pull requests against thev2
branch 😉.Looking for feedback
Pinging here @krisvanneste and @rcabdia who are the main API users.
Everybody else is welcome to contribute to the discussion!
The text was updated successfully, but these errors were encountered: