Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

priscavdsluis
Copy link
Contributor

No description provided.

@priscavdsluis priscavdsluis linked an issue Jul 3, 2023 that may be closed by this pull request
@sonarcloud
Copy link

sonarcloud bot commented Jul 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -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.
Copy link
Member

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")
Copy link
Member

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?

Copy link
Collaborator

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

Copy link
Collaborator

@veenstrajelmer veenstrajelmer left a 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")
Copy link
Collaborator

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"
)
Copy link
Collaborator

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")
Copy link
Collaborator

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(
Copy link
Collaborator

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:
Copy link
Collaborator

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

Comment on lines +150 to +159
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]
)
Copy link
Collaborator

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

Comment on lines +650 to +651
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])
Copy link
Collaborator

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

Comment on lines +332 to +355

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
Copy link
Collaborator

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

@veenstrajelmer
Copy link
Collaborator

This PR can be closed since the parts that are still relevant will be implemented as part of #674. The support for multiline friction files was judged to be not in scope in #143.

@veenstrajelmer veenstrajelmer deleted the feat/554-requested-changes-hydrologic branch July 8, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create branch with Hydrologic requested changes
3 participants