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

v3.2 #153

Open
wants to merge 180 commits into
base: master
Choose a base branch
from
Open

v3.2 #153

wants to merge 180 commits into from

Conversation

AngRodrigues
Copy link
Member

@AngRodrigues AngRodrigues commented Nov 24, 2024

Description

This version is compatible with LPF version available at Loop3D/LoopProjectFile#42

Includes features described in:

PR - #140
PR - #154
PR - #157
PR - #158
PR - #159

Major changes:

  1. Merged thickness calculator outputs:
    Methods set_thickness_calculator and get_thickness_calculator still available
    User can now choose up to 5 thickness calculators; also works with user-defined ThicknessCalculator class.
    Default is InterpolatedStructure.
    LPF stores results and name of the thickness calculator as a new field - LoopProjectFile.thicknessCalculatorType, which is a part of the StratigraphicLog object.
    ThicknessCalculatorAlpha updated to logic of the other calculators (e.g., to work from sampled_basal_contacts)
from map2loop.thickness_calculator import ThicknessCalculatorAlpha, InterpolatedStructure, StructuralPoint

[..set up the project..]

project.set_thickness_calculator([StructuralPoint(), InterpolatedStructure()])
project.get_thickness_calculator()

Output:
['StructuralPoint', 'InterpolatedStructure']
  1. Minimum fault length
    Minimum fault length is now a parameter of the config file,
    removes the faults with length under defined value; if set to None, minimum fault length is calculated from project's bbox,
    Removed the setter method to avoid double definition; getter method still available through proj.map_data.get_minimum_fault_length()
config_dictionary = {
  "structure" : {
    "dipdir_column": "azimuth2",
    "dip_column": "dip",},
  "geology" : {
    "unitname_column": "unitname",
    "alt_unitname_column": "code"}, 
  "fault": {
      "minimum_fault_length": 0.0}
}
  1. added all_basal_contacts object to mapdata
    mapdata.all_basal_contacts -> abnormal+basal contacts ,
    mapdata.basal_contacts -> holds only the basal.
    Reconstruction of sampled_basal_contacts is based on basal_contacts

  2. Added folder with datasets in map2loop/_datasets/geodata_files/hamersley
    The idea behind this is to have a data loading function, e.g., at the moment load_hamersley_geology() returns a gdf with the geology; structure and dtm are available, and others will keep being added as needed. This is quite useful for tests, but should also be useful for when we implement [Feature Request] - create map2loop project from geopandas array not file paths #74. The only thing about this is the location, which implies a long import: from map2loop._datasets.geodata_files.hamersley import load_hamersley_geology. Happy to change the file location - if anyone has a better suggestion?

  3. Added DependencyChecker class to __init__.py
    This was based on LG's suggestion to check the LPF version on import.
    I decided to expand on this and add this check for all libraries in map2loop/dependencies.txt

  4. Added ignore codes both for lithology and faults
    works by feature name, and similar to the existing method.
    Added methods for set and get with _ignore_lithology_codes() and _ignore_fault_codes().
    Example of working example code to achieve this can be seen in map2loop/tests/project/test_ignore_codes_setters_getters.py

Minor changes:

  • tmpfile is now used to create the localGdalfile
  • changed to f"" strings where possible
  • change from os.path.join to pathlib.Path where possible
  • added geopandas to csv converter in mapdata (it was on a #TODO)
  • added check and error message to make sure that all units in user_defined_stratigraphic_column are in the geology file (otherwise project creation fails; at least now user has a warning).
  • renamed distance to stratigraphic_distance in basal_contacts creation
  • simplified issue templates for easier form fill

Added tests:

  • for some of the functions in mapdata.py (includes minimum_fault_length)
  • for thickness_compute in project.py
  • ignore_codes setters and getters

Fixes #86
Fixes #110
Fixes #111
Fixes #12
Fixes #143
Fixes #137
Fixes #119
Fixes #155

Type of change

  • Documentation update
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Test improvement

How Has This Been Tested?

Branches:

⚠️ actions before merging! ⚠️

  • - release LPF 0.2
  • dependencies.txt need to be updated for the LPF version -> 0.2.1
  • make actions same as LPF and m2m (maybe add tests if possible)
  • - actions need to be reversed to use LPF main branch. Search for @fix_thicknesses
  • - docs docker build needs to be also changed to remove the @fix_thicknesses branch
  • - add feat commit for version bump
  • add to release notes: set_ignore_codes has change to set_ignore_lithology_codes

lachlangrose and others added 30 commits May 20, 2024 12:08
edit dddf70b chore: added issue_templates
lachlangrose and others added 27 commits November 29, 2024 17:32
…oject (#157)

* fix: use separate thickness table in LPF

* docs: remove unused docstring

* fix: min fault length can be int

* fix: bug in output of StructuralPoint

* fix: add the active_thickness_flag

---------

Co-authored-by: AngRodrigues <[email protected]>
* fix: simple fix for #155

* fix: decimation factor allows floats

* fix: decimation int
feat: remove option for legacy hson files
* fix: initial commit

* fix: add debug info and warning for bad calculations

* fix: add line length control to thickness calculators

* fix: refactor to avoid repetitive code

* fix: typo

* fix: remove list comprehension - wky

* fix list to df

* fix: revert to lst comprehension

* fix: make line length attribute of the TC class

* fix: typos

* fix: syntax

* fix: add location tracking

* fix: init commit to remove lst comprehension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment