Skip to content

Commit caa0ec3

Browse files
committed
update some bad field types noticed during metadata extractor tests
1 parent ad48949 commit caa0ec3

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

hsmodels/schemas/fields.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,15 @@ class Config:
286286
title="Variable unit",
287287
description="A string containing the units for the raster band variable",
288288
)
289-
no_data_value: str = Field(
289+
no_data_value: float = Field(
290290
default=None,
291291
title="Nodata value",
292-
description="A string containing the numeric nodata value for the raster band",
292+
description="A float containing the numeric nodata value for the raster band",
293293
)
294-
maximum_value: str = Field(
294+
maximum_value: float = Field(
295295
default=None,
296296
title="Maximum value",
297-
description="A string containing the maximum numeric value for the raster band",
297+
description="A float containing the maximum numeric value for the raster band",
298298
)
299299
comment: str = Field(
300300
default=None, title="Comment", description="A string containing a comment about the raster band"
@@ -304,10 +304,10 @@ class Config:
304304
title="Method",
305305
description="A string containing a description of the method used to create the raster band data",
306306
)
307-
minimum_value: str = Field(
307+
minimum_value: float = Field(
308308
default=None,
309309
title="Minimum value",
310-
description="A string containing the minimum numerica value for the raster dataset",
310+
description="A float containing the minimum numerica value for the raster dataset",
311311
)
312312

313313

@@ -328,11 +328,11 @@ class Config:
328328
)
329329
# TODO: What is the "field_type_code"? It's not displayed on the resource landing page, but it's encoded in the
330330
# aggregation metadata as an integer value.
331-
field_type_code: str = Field(
331+
field_type_code: int = Field(
332332
default=None,
333333
max_length=50,
334334
title="Field type code",
335-
description="A string value containing a code that indicates the field type",
335+
description="An integer value containing a code that indicates the field type",
336336
)
337337
field_width: int = Field(
338338
default=None, title="Field width", description="An integer value containing the width of the attribute field"
@@ -445,7 +445,7 @@ class Config:
445445
# TODO: The NoData value for a variable in an ODM2 database is not always an integer.
446446
# It could be a floating point value. We might want to change this to a string or a floating point value
447447
# It is an integer in the HydroShare database, so will have to be updated there as well if changed
448-
no_data_value: int = Field(title="NoData value", description="The NoData value for the variable")
448+
no_data_value: float = Field(title="NoData value", description="The NoData value for the variable")
449449
variable_definition: str = Field(
450450
default=None,
451451
max_length=255,
@@ -628,15 +628,18 @@ class Config:
628628
description="A string containing the status of the time series result chosen from the ODM2 Status controlled vocabulary",
629629
)
630630
sample_medium: str = Field(
631+
default=None,
631632
max_length=255,
632633
title="Sample medium",
633634
description="A string containing the sample medium in which the time series result was measured chosen from the ODM2 Medium controlled vocabulary",
634635
)
635636
value_count: int = Field(
637+
default=None,
636638
title="Value count",
637639
description="An integer value containing the number of data values contained within the time series result",
638640
)
639641
aggregation_statistic: str = Field(
642+
default=None,
640643
max_length=255,
641644
title="Aggregation statistic",
642645
description="A string containing the aggregation statistic associated with the values of the time series result chosen from the ODM2 Aggregation Statistic controlled vocabulary",
@@ -651,18 +654,22 @@ class Config:
651654
description="A string containing a label for the time series result",
652655
)
653656
site: TimeSeriesSite = Field(
657+
default=None,
654658
title="Site",
655659
description="An object containing metadata about the site at which the time series result was created",
656660
)
657661
variable: TimeSeriesVariable = Field(
658-
title="Variablef",
662+
default=None,
663+
title="Variable",
659664
description="An object containing metadata about the observed variable associated with the time series result values",
660665
)
661666
method: TimeSeriesMethod = Field(
667+
default=None,
662668
title="Method",
663669
description="An object containing metadata about the method used to produce the time series result values",
664670
)
665671
processing_level: ProcessingLevel = Field(
672+
default=None,
666673
title="Processing level",
667674
description="An object containing metadata about the processing level or level of quality control to which the time series result values have been subjected",
668675
)

0 commit comments

Comments
 (0)