diff --git a/src/coastseg/coastseg_map.py b/src/coastseg/coastseg_map.py index 02a0b18..96db8de 100644 --- a/src/coastseg/coastseg_map.py +++ b/src/coastseg/coastseg_map.py @@ -1840,6 +1840,8 @@ def extract_all_shorelines(self,roi_ids:list=None) -> None: Returns: None """ + if isinstance(roi_ids, str): + roi_ids = [roi_ids] # 1. validate the inputs for shoreline extraction exist: ROIs, transects,shorelines and a downloaded data for each ROI self.validate_extract_shoreline_inputs(roi_ids) diff --git a/src/coastseg/common.py b/src/coastseg/common.py index 826c190..491c381 100644 --- a/src/coastseg/common.py +++ b/src/coastseg/common.py @@ -1921,8 +1921,13 @@ def save_transects( filepath = os.path.join(save_location, "raw_transect_time_series_merged.csv") merged_timeseries_df.to_csv(filepath, sep=",",index=False) + # sort the columns + sorted_columns = [timeseries_df.columns[0]] + sorted(timeseries_df.columns[1:], key=lambda x: int(''.join(filter(str.isdigit, x)))) + timeseries_df = timeseries_df[sorted_columns] + filepath = os.path.join(save_location, "raw_transect_time_series.csv") timeseries_df.to_csv(filepath, sep=",",index=False) + # save transect settings to file transect_settings = get_transect_settings(settings) transect_settings_path = os.path.join(save_location, "transects_settings.json")