Skip to content

Commit

Permalink
Merge branch 'master' into api
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlangrose committed Sep 11, 2023
2 parents f9709b5 + c617562 commit b5be32e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
- name: Building and install
shell: bash -l {0}
run: |
python setup.py install build_ext --inplace
pip install .
- name: pytest
shell: bash -l {0}
Expand Down
3 changes: 1 addition & 2 deletions LoopStructural/interpolators/_discrete_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ def set_region(self, region=None):
"""
# evaluate the region function on the support to determine
# which nodes are inside update region map and degrees of freedom
print("Cannot use region")
# self.region_function = region
logger.info(
"Interpolation now uses region and has {} degrees of freedom".format(
"Cannot use region at the moment. Interpolation now uses region and has {} degrees of freedom".format(
self.nx
)
)
Expand Down
7 changes: 3 additions & 4 deletions LoopStructural/modelling/core/geological_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,9 +1455,8 @@ def create_and_add_domain_fault(self, fault_surface_data, **kwargs):
self._add_domain_fault_below(domain_fault)

domain_fault_uc = UnconformityFeature(domain_fault, 0)
# iterate over existing features and add the unconformity as a
# region so the feature is only
# evaluated where the unconformity is positive
# iterate over existing features and add the unconformity as a region
# so the feature is only evaluated where the unconformity is positive
return domain_fault_uc

def create_and_add_fault(
Expand Down Expand Up @@ -1551,7 +1550,7 @@ def create_and_add_fault(
# add data
fault_frame_data = self.data.loc[
self.data["feature_name"] == fault_surface_data
]
].copy()
trace_mask = np.logical_and(
fault_frame_data["coord"] == 0, fault_frame_data["val"] == 0
)
Expand Down
16 changes: 10 additions & 6 deletions LoopStructural/modelling/input/project_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def __init__(self, projectfile, use_thickness=None):
contacts.rename(columns=column_map, inplace=True)
fault_locations.rename(columns=column_map, inplace=True)
fault_orientations.rename(columns=column_map, inplace=True)
fault_locations["fault_name"] = [
f"Fault_{eventid}" for eventid in fault_locations["eventId"]
]
fault_orientations["fault_name"] = [
f"Fault_{eventid}" for eventid in fault_orientations["eventId"]
]
# fault_locations["fault_name"] = [
# f"Fault_{eventid}" for eventid in fault_locations["eventId"]
# ]
# fault_orientations["fault_name"] = [
# f"Fault_{eventid}" for eventid in fault_orientations["eventId"]
# ]
thicknesses = dict(
zip(
projectfile["stratigraphicLog"].name,
Expand All @@ -52,6 +52,10 @@ def __init__(self, projectfile, use_thickness=None):
},
inplace=True,
)
fault_locations = fault_properties.reset_index()[["name", "eventId"]].merge(fault_locations, on="eventId")
fault_locations["fault_name"] = fault_locations["name"]
fault_orientations = fault_properties.reset_index()[["name", "eventId"]].merge(fault_orientations, on="eventId")
fault_orientations["fault_name"] = fault_orientations["name"]
colours = dict(
zip(
self.projectfile.stratigraphicLog.name,
Expand Down
8 changes: 8 additions & 0 deletions LoopStructural/visualisation/model_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,14 @@ def add_isosurface(
xx, yy, zz = np.meshgrid(x, y, z, indexing="ij")
points = np.array([xx.flatten(), yy.flatten(), zz.flatten()]).T
val = geological_feature.evaluate_value(points)

# Check if there is sufficient values to anchor the feature in the model
# if not skip this feature
if len(np.unique(val)) == 1:
logger.warning(
f"No value information for {geological_feature.name}, skipping"
)
return return_container
mean_val = np.nanmean(val) # geological_feature.mean()
max_val = np.nanmax(val) # geological_feature.max()
min_val = np.nanmin(val) # geological_feature.min()
Expand Down

0 comments on commit b5be32e

Please sign in to comment.