Skip to content
Snippets Groups Projects
Commit 4f0d1c3c authored by Carsten Hinz's avatar Carsten Hinz
Browse files

added cartopy for interactive endpoint

started implementing a class to handle the contributors

removed contributors_role as this will not be part of the metadata of a gridded file
parent 7fc0c90d
No related branches found
No related tags found
3 merge requests!11Creation of first beta release version,!10change in metadata of notebook,!9change in metadata of notebook
......@@ -14,3 +14,4 @@ notTracked/
*.swp
log/
*/log/
.venv
......@@ -204,7 +204,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.7"
}
},
"nbformat": 4,
......
......@@ -48,6 +48,7 @@ installer = "uv"
extra-dependencies = [
"jupyter",
"ipykernel",
"cartopy"
]
[tool.hatch.envs.hatch-static-analysis]
......
class contributors:
def __init__(self, requestID, endpoint="not yet defined"):
self.requestID = requestID
self.timeseriesIDs = set()
self.endpoint = endpoint
def get_contributors_endpoint(self):
#TODO here, is the latest point to decide, if we need to provide an endpoint or a curl command to upload a time series id file
pass
def get_offline_command(self):
# write time series IDs to file
# save file
return f"curl {self.endpoint} -file {self.requestID}.contributors"
def get_service_contributors(self):
# TODO: missing implementation
raise NotImplementedError("This has not been implemented as this package is not yet operated as a service.")
def add_timeseries(self, id):
self.timeseriesIDs.add(id)
def add_many_timeseries(self, ids):
for id in ids:
self.timeseriesIDs.add(id)
......@@ -157,9 +157,7 @@ class RegularGrid(GridDefinition):
cell_indices = self.as_cell_index(coords)
# will convert cell_indices to float as some nans ar present
print(data)
data_with_indices = data.join(cell_indices.to_frame(GridDefinition.cell_index_name), how="outer")
print(data)
return data_with_indices.groupby(GridDefinition.cell_index_name)
......
......@@ -12,7 +12,6 @@
"publisher_email": "info@toar-data.org",
"publisher_url": "https://toar-data.fz-juelich.de/",
"contributor_name": "ask Martin, namen",
"contributor_role": "ask Martin",
"institution": "The Tropospheric Ozone Assessment Report (TOAR) Data Centre, Research Centre Jülich, Jülich, Germany",
"project": "TOAR-II",
"creator_type": "institution",
......
......@@ -429,6 +429,7 @@ class AnalysisService:
timeseries, timeseries_metadata = self.get_timeseries_and_metadata(metadata)
coords = self.get_clean_coords(timeseries_metadata)
timeseries = self.get_clean_timeseries(timeseries, metadata)
print(timeseries)
return AnalysisRequestResult(timeseries, coords, metadata)
def get_timeseries_and_metadata(self, metadata: Metadata) -> tuple[pd.DataFrame, pd.DataFrame]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment