Skip to content
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

Develop/2.0 #53

Merged
merged 38 commits into from
Sep 21, 2020
Merged

Develop/2.0 #53

merged 38 commits into from
Sep 21, 2020

Conversation

Dirack
Copy link
Owner

@Dirack Dirack commented Sep 21, 2020

📤 Pull Request

Description

Version 2.0 - stable release

  • Tests in the TDD directory that run with travis CI and locally with unittest python module. Run the tests in the TDD directory with:
~$ python -m unittest
  • Use pefInterpolation.py and kimodel.py recipes from the official Madagascar repository.
  • Separate model building and PEF interpolation from CRE stacking in different directories
  • Establish explicit dependencies in SConstructs to avoid errors during parallel building

Resolve #44 and #43

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Add images bellow and additional context if needed.

Use Depends scons method to explicit declare dependencies to scons
Changes pefInterpolation function calling from fullInterpolationAndStack
experiments.

The pefInterpolation.py recipe is now part of official Madagascar
package. Because of that, SConstruct can call it from local Madagascar
installation.
Error report function was deleted from official repository
because it makes building and error report slow. Use python
logging functions to report errors in SCons
The building of the experiment is splitted in several SConscripts.
Concatenate all the building steps in one SConstruct. And use the
Madagascar recipes 'kimodel.py' and 'pefInterpolation.py'.

Those recipes are available in the official Madagascar package
repository on github. Because of that they can be called from
SConstruct.
Because those recipes are available in Madagascar package
it is no longer require to store a copy of then in this repository
Define explicit dependencies to the experiments in multiLayerModel
with Depend method in scons to avoid errors in parallel building,
Resolve #44
The atexit will launch the after_build function that calls os.system
commands to remove rsf temporary files. And establish the datacube and
multiLayerDataCube as a stacked section dependency
Do a simple test of the experiments and SConstruct building for a
couple of (m0,t0) pairs
As referenced in bug report #49, aperture parameter should be the
same for the programs sfcrestack and sfgetcregather to avoid building
errors in the stacking. Aperture parameter is the number of offsets
to consider in the cre trajectory for sfgetcregather and the number
of offsets to stack in sfcrectack.

This parameter was introduced in sfgetcregather program to correct
bug #38
The stacked section depends of the creGatherTraces and creStackedTraces too.
So, Establish both as stacked section dependencies
To avoid multiple buildings of modeling and PEF interpolation steps
separate the modeling and interpolation in another directory
The variable 'file' was loaded before cre stacking loop. It used glob
method to receive the stacked traces list available in the directory
to sort and build the stacked section.

The problem is if the variable is loaded before the loop, glob won't
find any stacked traces, because they are not build already! So, in order
to explicit tell scons to load 'files' variable after the loop, put the
variable as an empty list and load the values during the for loop with
append method
To avoid problems and mixed outputs separate the models in two folders
This SConstruct tracks the experiments execution and does an automatic
report of then in latex. This is a simple test of the experiments with
a few common offset gathers interpolated and a few cre stacked traces
to build the stacked section
Use script 'clean.sh' to delete temporary files. The function
AddPostAction will assure that clean.sh will be called after the
'interpolatedDataCube2.rsf' building
The 'test_modelBuild.py' file tun the unit tests of the modeling
and PEF interpolation steps that will produce the input to the CRE
stacking step.

Run this test with:
~$ python -m unittest test_modelBuild
Tests of the experiments. Run with:

~$ python -m unittest test_experiments
Run tests suite in TDD directory using Travis CI. Those tests will
run in a docker container with Madagascar version 3.0 already installed.
When the tests pass, this package will be ready for version 2.0 deploy.
Download the experiments needed by SConstructs and install them in
the $RSFSRC/book/Recipes directory.
Travis allows to split the building in several jobs using stage
and 'script'. Stages are built sequentially, jobs are built in parallel
Travis CI allows to split the building in stages with stage
and call a Shell Script during the build. With TEST_SUITE
set with the name of the tests.
The modeling test will be split into two tests, one for the gaussian reflector and the other for the multilayer model.
Modify the SConstructs in modeling step to allow receive PEF interpolation
parameters through command line and difine default values for them.
Correct ARGUMENT.get to return the correct type (default is to return
a string). Join the experiment tests into correspondent model test
file. Tests related to gaussian model are stored in
'test_gaussianModelBuild.py' and tests related to the multi layer
model are stored in 'test_multiLayerModelBuild.py'.
Arguments passed through command line should be converted to correct
types
The experiment SConstructs now receive the aperture parameter to
be used in sfgetcretimecurve and sfcrestack programs
Always finish clean with 0 status despite it doesn't find all files
to delete
Tests are failing because vfsa package it is needed to run the cre
stack package
By default unittest module sorts the tests based on
tests name. Disable that option
Try to force model building to be built first
@Dirack Dirack added the enhancement New feature or request label Sep 21, 2020
@Dirack Dirack added this to the v2.0 milestone Sep 21, 2020
@Dirack Dirack self-assigned this Sep 21, 2020
@Dirack Dirack linked an issue Sep 21, 2020 that may be closed by this pull request
@Dirack Dirack marked this pull request as ready for review September 21, 2020 02:42
@Dirack Dirack merged commit 35169ad into master Sep 21, 2020
@Dirack Dirack deleted the develop/2.0 branch September 21, 2020 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant