Skip to content

Conversation

@noellehmcheng
Copy link
Contributor

I have made the following changes to remove the Sampler class dependency on MapData class:

  1. Moved get_value_from_raster_df and __value_from_raster from MapData to utils.py and renamed them to set_z_values_from_raster_df and value_from_raster
  2. Modified Sampler class to functions that take datasets directly instead of the entire MapData object
  3. Updated the corresponding code to accommodate these changes
  • extract_geology_contacts in project.py
  • calculate_fault_orientations in project.py
  • summarise_fault_data in project.py
  • sample in SamplerDecimator class
  • compute in InterpolatedStructure class

Validation
I ran the code in map2loop-notebooks/Example 3- Local Source Data.ipynb and compared the returned result from set_z_values_from_raster_df function inside extract_geology_contacts. The results from the current master branch and the refactored code are the same.

Copy link
Member

@lachlangrose lachlangrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the changes are good, but can you move all of the optional arguments from the sample/call methods of the samplers/calculators and make them constructor parameters in the init method. Then use the class attributes to access the variables.

@noellehmcheng
Copy link
Contributor Author

merged with branch 3.3.0 #223

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants