Skip to content

Commit

Permalink
move DatasetFormatForm to bottom of DatasetManagementForms mod to mak…
Browse files Browse the repository at this point in the history
…e python imports happy
  • Loading branch information
aaraney committed Oct 28, 2022
1 parent 5a7127d commit e8898c1
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions python/gui/MaaS/cbv/DatasetManagementForms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@
_ElementId = forms.CharField


class DatasetFormatForm(Enum):
AORC_CSV = AORC_CSV
NETCDF_FORCING_CANONICAL = NETCDF_FORCING_CANONICAL
NETCDF_AORC_DEFAULT = NETCDF_AORC_DEFAULT
NGEN_OUTPUT = NGEN_OUTPUT
NGEN_REALIZATION_CONFIG = NGEN_REALIZATION_CONFIG
NGEN_GEOJSON_HYDROFABRIC = NGEN_GEOJSON_HYDROFABRIC
NGEN_PARTITION_CONFIG = NGEN_PARTITION_CONFIG
BMI_CONFIG = BMI_CONFIG
NWM_OUTPUT = NWM_OUTPUT
NWM_CONFIG = NWM_CONFIG

@staticmethod
def get_form_from_name(name: str) -> Optional[forms.Form]:
try:
return DatasetFormatForm[name].value
except KeyError:
return None


class FormNameMixIn:
def form_name(self) -> str:
Expand Down Expand Up @@ -124,3 +105,22 @@ class NWM_CONFIG(FormNameMixIn, forms.Form):
start_time = _Time(label="Start Datetime")
end_time = _Time(label="End Datetime")
data_id = _DataId

class DatasetFormatForm(Enum):
AORC_CSV = AORC_CSV
NETCDF_FORCING_CANONICAL = NETCDF_FORCING_CANONICAL
NETCDF_AORC_DEFAULT = NETCDF_AORC_DEFAULT
NGEN_OUTPUT = NGEN_OUTPUT
NGEN_REALIZATION_CONFIG = NGEN_REALIZATION_CONFIG
NGEN_GEOJSON_HYDROFABRIC = NGEN_GEOJSON_HYDROFABRIC
NGEN_PARTITION_CONFIG = NGEN_PARTITION_CONFIG
BMI_CONFIG = BMI_CONFIG
NWM_OUTPUT = NWM_OUTPUT
NWM_CONFIG = NWM_CONFIG

@staticmethod
def get_form_from_name(name: str) -> Optional[forms.Form]:
try:
return DatasetFormatForm[name].value
except KeyError:
return None

0 comments on commit e8898c1

Please sign in to comment.