diff --git a/hsmodels/schemas/fields.py b/hsmodels/schemas/fields.py
index b7150a3..f55a39b 100644
--- a/hsmodels/schemas/fields.py
+++ b/hsmodels/schemas/fields.py
@@ -286,15 +286,15 @@ class Config:
title="Variable unit",
description="A string containing the units for the raster band variable",
)
- no_data_value: str = Field(
+ no_data_value: float = Field(
default=None,
title="Nodata value",
- description="A string containing the numeric nodata value for the raster band",
+ description="A float containing the numeric nodata value for the raster band",
)
- maximum_value: str = Field(
+ maximum_value: float = Field(
default=None,
title="Maximum value",
- description="A string containing the maximum numeric value for the raster band",
+ description="A float containing the maximum numeric value for the raster band",
)
comment: str = Field(
default=None, title="Comment", description="A string containing a comment about the raster band"
@@ -304,10 +304,10 @@ class Config:
title="Method",
description="A string containing a description of the method used to create the raster band data",
)
- minimum_value: str = Field(
+ minimum_value: float = Field(
default=None,
title="Minimum value",
- description="A string containing the minimum numerica value for the raster dataset",
+ description="A float containing the minimum numerica value for the raster dataset",
)
@@ -328,11 +328,10 @@ class Config:
)
# TODO: What is the "field_type_code"? It's not displayed on the resource landing page, but it's encoded in the
# aggregation metadata as an integer value.
- field_type_code: str = Field(
+ field_type_code: int = Field(
default=None,
- max_length=50,
title="Field type code",
- description="A string value containing a code that indicates the field type",
+ description="An integer value containing a code that indicates the field type",
)
field_width: int = Field(
default=None, title="Field width", description="An integer value containing the width of the attribute field"
@@ -445,7 +444,7 @@ class Config:
# TODO: The NoData value for a variable in an ODM2 database is not always an integer.
# It could be a floating point value. We might want to change this to a string or a floating point value
# It is an integer in the HydroShare database, so will have to be updated there as well if changed
- no_data_value: int = Field(title="NoData value", description="The NoData value for the variable")
+ no_data_value: float = Field(title="NoData value", description="The NoData value for the variable")
variable_definition: str = Field(
default=None,
max_length=255,
@@ -628,15 +627,18 @@ class Config:
description="A string containing the status of the time series result chosen from the ODM2 Status controlled vocabulary",
)
sample_medium: str = Field(
+ default=None,
max_length=255,
title="Sample medium",
description="A string containing the sample medium in which the time series result was measured chosen from the ODM2 Medium controlled vocabulary",
)
value_count: int = Field(
+ default=None,
title="Value count",
description="An integer value containing the number of data values contained within the time series result",
)
aggregation_statistic: str = Field(
+ default=None,
max_length=255,
title="Aggregation statistic",
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 +653,22 @@ class Config:
description="A string containing a label for the time series result",
)
site: TimeSeriesSite = Field(
+ default=None,
title="Site",
description="An object containing metadata about the site at which the time series result was created",
)
variable: TimeSeriesVariable = Field(
- title="Variablef",
+ default=None,
+ title="Variable",
description="An object containing metadata about the observed variable associated with the time series result values",
)
method: TimeSeriesMethod = Field(
+ default=None,
title="Method",
description="An object containing metadata about the method used to produce the time series result values",
)
processing_level: ProcessingLevel = Field(
+ default=None,
title="Processing level",
description="An object containing metadata about the processing level or level of quality control to which the time series result values have been subjected",
)
diff --git a/tests/data/json/geographicfeature.json b/tests/data/json/geographicfeature.json
index 1ca720c..62ba10e 100644
--- a/tests/data/json/geographicfeature.json
+++ b/tests/data/json/geographicfeature.json
@@ -26,39 +26,39 @@
{
"field_name": "Id",
"field_type": "Integer64",
- "field_type_code": "12",
+ "field_type_code": 12,
"field_width": 10
},
{
"field_name": "Shape_Area",
"field_type": "Real",
- "field_type_code": "2",
+ "field_type_code": 2,
"field_width": 19,
"field_precision": 11
},
{
"field_name": "Area_km2",
"field_type": "Real",
- "field_type_code": "2",
+ "field_type_code": 2,
"field_width": 19,
"field_precision": 11
},
{
"field_name": "OBJECTID",
"field_type": "Integer64",
- "field_type_code": "12",
+ "field_type_code": 12,
"field_width": 10
},
{
"field_name": "gridcode",
"field_type": "Integer64",
- "field_type_code": "12",
+ "field_type_code": 12,
"field_width": 10
},
{
"field_name": "Shape_Leng",
"field_type": "Real",
- "field_type_code": "2",
+ "field_type_code": 2,
"field_width": 19,
"field_precision": 11
}
diff --git a/tests/data/json/geographicraster.json b/tests/data/json/geographicraster.json
index cdb7226..8c85d67 100644
--- a/tests/data/json/geographicraster.json
+++ b/tests/data/json/geographicraster.json
@@ -27,11 +27,11 @@
"name": "Band_1",
"variable_name": "variablename",
"variable_unit": "variableunit",
- "no_data_value": "-3.4028234663852886E+38",
- "maximum_value": "6.9103932008822E-310",
+ "no_data_value": -3.4028234663852886E+38,
+ "maximum_value": 6.9103932008822E-310,
"comment": "comment",
"method": "method",
- "minimum_value": "2.67393466E-316"
+ "minimum_value": 2.67393466E-316
},
"spatial_reference": {
"type": "box",
diff --git a/tests/data/metadata/geographicfeature_meta.xml b/tests/data/metadata/geographicfeature_meta.xml
index 9df2c69..1b6d3b8 100644
--- a/tests/data/metadata/geographicfeature_meta.xml
+++ b/tests/data/metadata/geographicfeature_meta.xml
@@ -12,7 +12,7 @@
Real
Shape_Leng
19
- 2
+ 2
11
@@ -30,7 +30,7 @@
fdas
- 12
+ 12
OBJECTID
Integer64
10
@@ -52,7 +52,7 @@
Shape_Area
- 2
+ 2
19
Real
11
@@ -95,7 +95,7 @@
Integer64
- 12
+ 12
10
Id
@@ -103,7 +103,7 @@
asdf
- 2
+ 2
Real
19
11
@@ -112,7 +112,7 @@
- 12
+ 12
10
Integer64
gridcode
diff --git a/tests/data/metadata/geographicraster_meta.xml b/tests/data/metadata/geographicraster_meta.xml
index b06d331..40b083f 100644
--- a/tests/data/metadata/geographicraster_meta.xml
+++ b/tests/data/metadata/geographicraster_meta.xml
@@ -56,13 +56,13 @@
- 2.67393466E-316
+ 2.67393466E-316
variableunit
comment
- 6.9103932008822E-310
+ 6.9103932008822E-310
variablename
Band_1
- -3.4028234663852886E+38
+ -3.4028234663852886E+38
method
diff --git a/tests/data/metadata/timeseries_meta.xml b/tests/data/metadata/timeseries_meta.xml
index 35ffa8c..77c1a3a 100644
--- a/tests/data/metadata/timeseries_meta.xml
+++ b/tests/data/metadata/timeseries_meta.xml
@@ -57,7 +57,7 @@
USU36
- -9999
+ -9999
Temperature
Water Quality
Not Applicable
@@ -99,7 +99,7 @@
USU36
- -9999
+ -9999
Temperature
Water Quality
Not Applicable
@@ -146,7 +146,7 @@
Water Quality
Temperature
USU36
- -9999
+ -9999
Surface Water
@@ -178,7 +178,7 @@
Water Quality
Not Applicable
USU36
- -9999
+ -9999
Temperature
@@ -250,7 +250,7 @@
Not Applicable
Water Quality
USU36
- -9999
+ -9999
Temperature
@@ -330,7 +330,7 @@
USU36
- -9999
+ -9999
Temperature
Water Quality
Not Applicable
@@ -383,7 +383,7 @@
Not Applicable
Water Quality
USU36
- -9999
+ -9999
Temperature