Skip to content

Commit

Permalink
#208 remove all shoreline_settings.json instances
Browse files Browse the repository at this point in the history
  • Loading branch information
2320sharon committed Feb 10, 2024
1 parent 35e1dfa commit 3a2e8fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
25 changes: 2 additions & 23 deletions src/coastseg/coastseg_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,8 @@ def load_session_files(self, dir_path: str,data_path:str="") -> None:
Load the configuration files from the given directory.
The function looks for the following files in the directory:
- config_gdf.geojson: contains the configuration settings for the project
- shoreline_settings.json: contains the settings for the shoreline module
- config_gdf.geojson: contain the geometries of objects saved to the session
- config.json: contains the configuration settings for the session
If the config_gdf.geojson file is not found, a message is printed to the console.
Args:
Expand All @@ -592,26 +591,6 @@ def load_session_files(self, dir_path: str,data_path:str="") -> None:
self.load_metadata(ids=list(self.rois.roi_settings.keys()))
else:
logger.warning(f"No ROIs were able to have their metadata loaded.")
# load in setting from shoreline_settings.json
for file_name in os.listdir(dir_path):
file_path = os.path.join(dir_path, file_name)
if not os.path.isfile(file_path):
continue
if file_name == "shoreline_settings.json":
keys = [
"cloud_thresh",
"cloud_mask_issue",
"min_beach_area",
"min_length_sl",
"output_epsg",
"sand_color",
"pan_off",
"max_dist_ref",
"dist_clouds",
"percent_no_data",
]
settings = common.load_settings(file_path, keys)
self.set_settings(**settings)
if not config_loaded:
logger.info(f"Not all config files not found at {dir_path}")

Expand Down
9 changes: 0 additions & 9 deletions src/coastseg/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,6 @@ def save_extracted_shorelines(
The function saves the following files in the specified save_path:
- extracted_shorelines.geojson: contains the extracted shorelines as a GeoJSON object.
- shoreline_settings.json: contains the shoreline settings as JSON data.
- extracted_shorelines_dict.json: contains the extracted shorelines dictionary as JSON data.
:param extracted_shorelines: An Extracted_Shoreline object containing the extracted shorelines, shoreline settings, and dictionary.
Expand All @@ -2402,14 +2401,6 @@ def save_extracted_shorelines(
extracted_shorelines.to_file(
save_path, "extracted_shorelines_points.geojson", projected_gdf
)

# Save shoreline settings as a JSON file
extracted_shorelines.to_file(
save_path,
"shoreline_settings.json",
extracted_shorelines.shoreline_settings,
)

# Save extracted shorelines dictionary as a JSON file
extracted_shorelines.to_file(
save_path,
Expand Down

0 comments on commit 3a2e8fe

Please sign in to comment.