diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 9c2bab617..b9599ff1e 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -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} diff --git a/LoopStructural/interpolators/_discrete_interpolator.py b/LoopStructural/interpolators/_discrete_interpolator.py index 23576fb47..fab4c65dd 100644 --- a/LoopStructural/interpolators/_discrete_interpolator.py +++ b/LoopStructural/interpolators/_discrete_interpolator.py @@ -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 ) ) diff --git a/LoopStructural/modelling/core/geological_model.py b/LoopStructural/modelling/core/geological_model.py index 8af0889b8..6c5b98f24 100644 --- a/LoopStructural/modelling/core/geological_model.py +++ b/LoopStructural/modelling/core/geological_model.py @@ -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( @@ -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 ) diff --git a/LoopStructural/modelling/input/project_file.py b/LoopStructural/modelling/input/project_file.py index 660caafaf..779254348 100644 --- a/LoopStructural/modelling/input/project_file.py +++ b/LoopStructural/modelling/input/project_file.py @@ -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, @@ -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, diff --git a/LoopStructural/visualisation/model_plotter.py b/LoopStructural/visualisation/model_plotter.py index b1575b76e..3ac5d016f 100644 --- a/LoopStructural/visualisation/model_plotter.py +++ b/LoopStructural/visualisation/model_plotter.py @@ -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()