Issue 395 - Adds support for reading the sources as a yaml-node #403
+206
−44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current framework of defining the source-file makes it difficult to read the
specfem_config.yaml
. This dislodges the current setup of reading databases and sources together. By creating asetup.sources
entity andsetup.get_sources
which returns aYAML::Node
.If the
source-file
is definedsetup.sources
will be populated with aYAML::Node
that is loaded fromsource-file
. Ifsource-dict
is definedsetup.sources
is populated directly with thesource-dict
YAML::Node
.This allows for defining the sources in Python as part of the
runtime_config
dictionary.See here for a very barebone implementation of a simulation in Python with bathymetry: Example
For now I'm not adding documentation because I do not think we want the CPP user to use the code like this.
Also, a general overhaul of the setup structure may be necessary. To not break anything
setup.get_databases()
still returns a tuple, butsource_database
is an empty string of thedatabase_configuration
was instantiated with usingsource-dict
.Issue Number
Closes #395
Checklist
Please make sure to check developer documentation on specfem docs.
I have added/updated documentation for the changes I am proposing