From f94e18d99bc2fa9039b721e9ded465e68d34200f Mon Sep 17 00:00:00 2001 From: changliao1025 Date: Mon, 16 Oct 2023 16:32:50 -0700 Subject: [PATCH] update some dep issue --- .../auxiliary/calculate_area_of_difference.py | 13 +++++++------ pyflowline/classes/pycase.py | 10 +++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py index e2508efe..10e8657d 100644 --- a/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py +++ b/pyflowline/algorithms/auxiliary/calculate_area_of_difference.py @@ -13,12 +13,7 @@ else: from pyflowline.algorithms.auxiliary.find_vertex_in_list import find_vertex_in_list -iFlag_shapely = importlib.util.find_spec("shapely") -if iFlag_shapely is not None: - from shapely.ops import polygonize -else: - print('shapely is required for this function') - pass + def calculate_area_of_difference_raw(sFilename_a, sFilename_b): @@ -26,6 +21,12 @@ def calculate_area_of_difference_raw(sFilename_a, sFilename_b): return def calculate_area_of_difference_simplified(aFlowline_in, aVertex_all_in, sFilename_output_in): + iFlag_shapely = importlib.util.find_spec("shapely") + if iFlag_shapely is not None: + from shapely.ops import polygonize + else: + print('shapely is required for this function') + pass if os.path.exists(sFilename_output_in): os.remove(sFilename_output_in) pass diff --git a/pyflowline/classes/pycase.py b/pyflowline/classes/pycase.py index 0fe90931..744be100 100644 --- a/pyflowline/classes/pycase.py +++ b/pyflowline/classes/pycase.py @@ -240,6 +240,11 @@ def __init__(self, aConfig_in, self.iFlag_intersect = int(aConfig_in['iFlag_intersect']) else: self.iFlag_intersect=1 + + if self.iFlag_flowline == 1: + pass + else: + self.iFlag_intersect=0 if 'iFlag_break_by_distance' in aConfig_in: self.iFlag_break_by_distance = int(aConfig_in['iFlag_break_by_distance']) @@ -441,6 +446,7 @@ def __init__(self, aConfig_in, else: pass else: + pass @@ -507,7 +513,7 @@ def mesh_generation(self, iFlag_antarctic_in=None): #create a polygon based on real boundary pBoundary_wkt, aExtent = read_mesh_boundary(self.sFilename_mesh_boundary) - if iMesh_type != 4: #mpas + if iMesh_type != 4: #not mpas spatial_reference_target = osr.SpatialReference() spatial_reference_target.ImportFromEPSG(4326) @@ -1044,8 +1050,6 @@ def change_model_parameter(self, sVariable_in, dValue, iFlag_basin_in = None): print("This model parameter is unknown, please check the full parameter list in the documentation: " + sVariable_in) return False - - def run(self): """ Run the flowlinecase simulation