-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
554: Requested changes for hydrologic #556
Conversation
Kudos, SonarCloud Quality Gate passed!
|
@@ -166,7 +167,7 @@ class Comments(INIBasedModel.Comments): | |||
levels: Optional[List[float]] | |||
numlocations: Optional[NonNegativeInt] = Field(0, alias="numLocations") | |||
chainage: Optional[List[float]] | |||
frictionvalues: Optional[List[float]] = Field( | |||
frictionvalues: Optional[List[List[float]]] = Field( | |||
alias="frictionValues" | |||
) # TODO: turn this into List[List[float]], see issue #143. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This todo can now be removed?
@@ -243,7 +243,7 @@ class Comments(CrossSectionDefinition.Comments): | |||
type: Literal["rectangle"] = Field("rectangle") | |||
width: float | |||
height: float | |||
closed: bool = Field(True) | |||
closed: str = Field("no") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the type and inverting the default value is quite breaking. I'm not sure what the question was, but this might be solved by a custom reader/writer (or flag type) that translates the boolean into yes/no strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't do this anymore, we stick with booleans and the GUI should be updated (maybe was already updated): #545
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went trough all the changes and I think this PR can be closed now
@@ -243,7 +243,7 @@ class Comments(CrossSectionDefinition.Comments): | |||
type: Literal["rectangle"] = Field("rectangle") | |||
width: float | |||
height: float | |||
closed: bool = Field(True) | |||
closed: str = Field("no") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
won't do this anymore, we stick with booleans and the GUI should be updated (maybe was already updated): #545
@@ -1613,6 +1613,9 @@ class Comments(INIBasedModel.Comments): | |||
sigmagrowthfactor: Optional[str] = Field( | |||
"layer thickness growth factor from bed up.", alias="sigmaGrowthFactor" | |||
) | |||
dxmin1d: Optional[str] = Field( | |||
"Minimum 1D link length [m]", alias="dxmin1D" | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyword is already present in main
@@ -1701,6 +1704,7 @@ class Comments(INIBasedModel.Comments): | |||
numtopsig: int = Field(0, alias="numTopSig") | |||
numtopsiguniform: bool = Field(True, alias="numTopSigUniform") | |||
sigmagrowthfactor: float = Field(1.0, alias="sigmaGrowthFactor") | |||
dxmin1d: float = Field(0.001, alias="dxmin1D") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keyword is already present in main
@@ -166,7 +167,7 @@ class Comments(INIBasedModel.Comments): | |||
levels: Optional[List[float]] | |||
numlocations: Optional[NonNegativeInt] = Field(0, alias="numLocations") | |||
chainage: Optional[List[float]] | |||
frictionvalues: Optional[List[float]] = Field( | |||
frictionvalues: Optional[List[List[float]]] = Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supporting multiline friction values was decided against, the relevant issue was marked as "won't do": #143
@@ -217,7 +218,7 @@ def _validate_frictionvalues(cls, v, values): | |||
else values["numlevels"] | |||
) | |||
numvals = max(1, values["numlocations"]) * numlevels | |||
if v is not None and len(v) != numvals: | |||
if v is not None and np.asarray(v).size != numvals: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supporting multiline friction values was decided against, the relevant issue was marked as "won't do": #143
if isinstance(v[0], list): | ||
converted_lines = [] | ||
for values_for_line in v: | ||
converted_line = self.__class__.get_list_field_delimiter(key).join([convert_value(x) for x in values_for_line]) | ||
converted_lines.append(converted_line) | ||
return "\n".join(converted_lines) | ||
else: | ||
return self.__class__.get_list_field_delimiter(key).join( | ||
[convert_value(x) for x in v] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Supporting multiline friction values was decided against, the relevant issue was marked as "won't do": #143
self.link1d2d_id = np.array([f"{n1d:d}_{f2d:d}" for n1d, f2d in self.link1d2d]) | ||
self.link1d2d_long_name = np.array([f"{n1d:d}_{f2d:d}" for n1d, f2d in self.link1d2d]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to separate PR: #674
|
||
mesh_edge_x = ncfile.createVariable("mesh1d_edge_x", np.float64, "mesh1d_nEdges") | ||
mesh_edge_x.standard_name = "projection_x_coordinate" | ||
mesh_edge_x.long_name = "Characteristic x-coordinate of the mesh edge (e.g. midpoint)" | ||
mesh_edge_x.units = "m" | ||
mesh_edge_x[:] = mesh1d.mesh1d_edge_x | ||
|
||
mesh_edge_y = ncfile.createVariable("mesh1d_edge_y", np.float64, "mesh1d_nEdges") | ||
mesh_edge_y.standard_name = "projection_y_coordinate" | ||
mesh_edge_y.long_name = "Characteristic y-coordinate of the mesh edge (e.g. midpoint)" | ||
mesh_edge_y.units = "m" | ||
mesh_edge_y[:] = mesh1d.mesh1d_edge_y | ||
|
||
mesh_node_x = ncfile.createVariable("mesh1d_node_x", np.float64, "mesh1d_nNodes") | ||
mesh_node_x.standard_name = "projection_x_coordinate" | ||
mesh_node_x.long_name = "x coordinates of mesh nodes" | ||
mesh_node_x.units = "m" | ||
mesh_node_x[:] = mesh1d.mesh1d_node_x | ||
|
||
mesh_node_y = ncfile.createVariable("mesh1d_node_y", np.float64, "mesh1d_nNodes") | ||
mesh_node_y.standard_name = "projection_y_coordinate" | ||
mesh_node_y.long_name = "y coordinates of mesh nodes" | ||
mesh_node_y.units = "m" | ||
mesh_node_y[:] = mesh1d.mesh1d_node_y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to separate PR: #674
No description provided.