consistently use two blank lines between class definitions
This commit is contained in:
parent
57f91dfd89
commit
a1dde022fa
|
@ -74,6 +74,7 @@ def timeout(func, timeout=5):
|
|||
|
||||
return wrapper
|
||||
|
||||
|
||||
def check_headers(expected_headers, actual_headers, header_type='header'):
|
||||
"""Validate that expected headers are in a list of actual headers.
|
||||
|
||||
|
@ -107,6 +108,7 @@ def check_headers(expected_headers, actual_headers, header_type='header'):
|
|||
header_name=expected,
|
||||
number=count)
|
||||
|
||||
|
||||
def _check_projection(srs, projected, projection_units):
|
||||
"""Validate a GDAL projection.
|
||||
|
||||
|
@ -160,6 +162,7 @@ class IterableWithDotAccess():
|
|||
def to_json(self):
|
||||
return self.inputs_dict
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class Input:
|
||||
"""A data input, or parameter, of an invest model.
|
||||
|
@ -193,6 +196,7 @@ class Input:
|
|||
allowed: typing.Union[bool, str] = True
|
||||
hidden: bool = False
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class Output:
|
||||
"""A data output, or result, of an invest model.
|
||||
|
@ -213,6 +217,7 @@ class Output:
|
|||
about: str = ''
|
||||
created_if: typing.Union[bool, str] = True
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class FileInput(Input):
|
||||
"""A generic file input, or parameter, of an invest model.
|
||||
|
@ -267,6 +272,7 @@ class FileInput(Input):
|
|||
lambda p: p if pandas.isna(p) else utils.expand_path(str(p).strip(), base_path)
|
||||
).astype(pandas.StringDtype())
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class SingleBandRasterInput(FileInput):
|
||||
"""A single-band raster input, or parameter, of an invest model.
|
||||
|
@ -769,6 +775,7 @@ class NumberInput(Input):
|
|||
"""
|
||||
return col.astype(float)
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class IntegerInput(Input):
|
||||
"""An integer input, or parameter, of an invest model."""
|
||||
|
@ -888,6 +895,7 @@ class BooleanInput(Input):
|
|||
"""
|
||||
return col.astype('boolean')
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class StringInput(Input):
|
||||
"""A string input, or parameter, of an invest model.
|
||||
|
@ -982,6 +990,7 @@ class OptionStringInput(Input):
|
|||
lambda s: s if pandas.isna(s) else str(s).strip().lower()
|
||||
).astype(pandas.StringDtype())
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class SingleBandRasterOutput(Output):
|
||||
"""A single-band raster output, or result, of an invest model.
|
||||
|
@ -995,6 +1004,7 @@ class SingleBandRasterOutput(Output):
|
|||
"""
|
||||
band: typing.Union[Output, None] = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class VectorOutput(Output):
|
||||
"""A vector output, or result, of an invest model.
|
||||
|
@ -1011,6 +1021,7 @@ class VectorOutput(Output):
|
|||
geometry_types: set = dataclasses.field(default_factory=set)
|
||||
fields: typing.Union[typing.Iterable[Output], None] = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class CSVOutput(Output):
|
||||
"""A CSV table output, or result, of an invest model.
|
||||
|
@ -1032,6 +1043,7 @@ class CSVOutput(Output):
|
|||
rows: typing.Union[typing.Iterable[Output], None] = None
|
||||
index_col: typing.Union[str, None] = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class DirectoryOutput(Output):
|
||||
"""A directory output, or result, of an invest model.
|
||||
|
@ -1046,6 +1058,7 @@ class DirectoryOutput(Output):
|
|||
"""
|
||||
contents: typing.Union[typing.Iterable[Input], None] = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class FileOutput(Output):
|
||||
"""A generic file output, or result, of an invest model.
|
||||
|
@ -1055,6 +1068,7 @@ class FileOutput(Output):
|
|||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class NumberOutput(Output):
|
||||
"""A floating-point number output, or result, of an invest model.
|
||||
|
@ -1067,11 +1081,13 @@ class NumberOutput(Output):
|
|||
"""
|
||||
units: typing.Union[pint.Unit, None] = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class IntegerOutput(Output):
|
||||
"""An integer output, or result, of an invest model."""
|
||||
pass
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class RatioOutput(Output):
|
||||
"""A ratio output, or result, of an invest model.
|
||||
|
@ -1081,6 +1097,7 @@ class RatioOutput(Output):
|
|||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class PercentOutput(Output):
|
||||
"""A percent output, or result, of an invest model.
|
||||
|
@ -1090,6 +1107,7 @@ class PercentOutput(Output):
|
|||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class StringOutput(Output):
|
||||
"""A string output, or result, of an invest model.
|
||||
|
@ -1099,6 +1117,7 @@ class StringOutput(Output):
|
|||
"""
|
||||
pass
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class OptionStringOutput(Output):
|
||||
"""A string output, or result, which is limited to a set of options.
|
||||
|
@ -1108,6 +1127,7 @@ class OptionStringOutput(Output):
|
|||
"""
|
||||
options: typing.Union[list, None] = None
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class ModelSpec:
|
||||
model_id: str
|
||||
|
|
Loading…
Reference in New Issue