Skip to content
Snippets Groups Projects
Commit 5fa73e89 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

ENH: Use correct datamodel in special tretment lists

parent 206daaef
No related branches found
No related tags found
1 merge request!1F awi sams
...@@ -57,115 +57,68 @@ def _use_custom_names(definition: Union[list, dict]): ...@@ -57,115 +57,68 @@ def _use_custom_names(definition: Union[list, dict]):
DATATYPE_DEFINITIONS = _use_custom_names({ DATATYPE_DEFINITIONS = _use_custom_names({
"AphiaID": int,
"entity_id": str,
"Campaign": str, "Campaign": str,
"Fixation": str, "Elevation start": float,
"Gear configuration": str, "Elevation stop": float,
"Gear": str,
"Hol": int,
"Latitude start": float, "Latitude start": float,
"Latitude stop": float, "Latitude stop": float,
"Longitude start": float, "Longitude start": float,
"Longitude stop": float, "Longitude stop": float,
"Main User": str, "Main User": str,
"Nagoya case number": str,
"PI": str, "PI": str,
"Parent LinkAhead ID": str, "Parent LinkAhead ID": str,
"Platform": str, "SampleMethod": str,
"Sample Context": str,
"Sample container": str,
"SampleType": str, "SampleType": str,
"SampleTypeSpecific": str,
"Sampling Person": str,
"Sampling depth start": float,
"Sampling depth stop": float,
"Sampling method": str,
"Station ID": str,
"Station number": str,
"Storage Container Label": str,
"Storage ID": str, "Storage ID": str,
"StorageTemperature": str, "entity_id": str,
"Subevent": str,
"Water depth start": float,
"Water depth stop": float,
}) })
# Obligatory columns: Must exist and must not be empty # Obligatory columns: Must exist and must not be empty
# Must exist # Must exist
OBLIGATORY_COLUMNS = _use_custom_names([ OBLIGATORY_COLUMNS = _use_custom_names([
"entity_id", "entity_id",
"Device",
"Latitude start",
"Longitude start",
"Main User",
"PI",
"Sample container",
"SampleType",
"Sphere",
"Storage ID",
"StorageTemperature",
]) ])
OBLIGATORY_COLUMNS_CHILD = _use_custom_names([ OBLIGATORY_COLUMNS_CHILD = _use_custom_names([
"entity_id", "entity_id",
"Main User",
"Parent LinkAhead ID", "Parent LinkAhead ID",
"Sample container",
"SampleType",
"SampleTypeSpecific",
"Sphere",
"Storage ID",
"StorageTemperature",
]) ])
COLUMN_CONVERTER = _use_custom_names({ COLUMN_CONVERTER = _use_custom_names({
"Collection": semicolon_separated_list, "Collector": semicolon_separated_list,
"Ecotaxa URL": semicolon_separated_list, "Curator": semicolon_separated_list,
"NCBI Accession": semicolon_separated_list,
"NCBI BioProject": semicolon_separated_list,
"NCBI BioSample": semicolon_separated_list,
"OSIS URL": semicolon_separated_list,
"Embargo": _embargo_converter, "Embargo": _embargo_converter,
"Publications": semicolon_separated_list, "Event responsible": semicolon_separated_list,
"Sphere": semicolon_separated_list, "Sphere": semicolon_separated_list,
}) })
SPECIAL_TREATMENT_SAMPLE = _use_custom_names([ SPECIAL_TREATMENT_SAMPLE = _use_custom_names([
"entity_id", "Biome",
"Collection", "Campaign",
"Gear configuration", "Elevation start",
"Gear", "Elevation stop",
"Hol", "End date",
"Event responsible",
"IGSN DOI",
"Latitude start", "Latitude start",
"Latitude stop", "Latitude stop",
"Level",
"Locality description",
"Locality name",
"Longitude start", "Longitude start",
"Longitude stop", "Longitude stop",
"Main User", "Main User",
"Nagoya case number",
"PDFReport", "PDFReport",
"PI",
"Parent Linkahead ID", "Parent Linkahead ID",
"Person",
"Sampling Person",
"Sampling depth start",
"Sampling depth stop",
"Sphere", "Sphere",
"Station ID", "Sphere",
"Station number", "Start date",
"Storage Container Label",
"Storage ID", "Storage ID",
"Subevent", "entity_id",
"Water depth start",
"Water depth stop",
]) ])
IGNORED_COLUMN_NAMES_SAMPLE = _use_custom_names([ IGNORED_COLUMN_NAMES_SAMPLE = _use_custom_names([
"LinkAhead URL", "LinkAhead URL",
"IGSN URL",
"IGSN", # TODO This will be relevant for external IGSNs in the future.
"Parent Sample", "Parent Sample",
"Sampling depth",
"Storage chain", "Storage chain",
"Water depth",
]) ])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment