[ARC] Improve SWASH output handling and scatter matrix visualization - #163
Closed
albaricondo wants to merge 3 commits into
Closed
albaricondo wants to merge 3 commits into
albaricondo wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved issues affect template generation, SFINCS case creation, SWASH conversion, and scatter plotting.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 7
Open (8)
Restore template file creation in build_case_and_render_files · New Derive simulation dates from case forcing data · New Initialize self.sf before building cases · New Prevent concurrent mutation of the shared model root · New Restore final model write for generated case files · New Request Depth in the SWASH output table · New Add Depth to the converter input table or remove its lookup · New Pass antecedent moisture condition instead of raster name · New
What changed in this PR
This PR updates SWASH output handling, enhances scatter-matrix visualization, and refactors SFINCS case generation.
Changes:
- Revises SWASH output conversion and dry-point masking.
- Adds selectable variables and shared color-based visualization to scatter plots.
- Refactors SFINCS template, forcing, and model setup.
- Modifies template rendering during case builds.
| File | Summary |
|---|---|
bluemath_tk/wrappers/swash/templates/INPUT |
Updates SWASH table output quantities. |
bluemath_tk/wrappers/swash/swash_wrapper.py |
Converts revised SWASH output and applies dry-point masking. |
bluemath_tk/wrappers/sfincs/sfincs_wrapper.py |
Changes SFINCS model, infiltration, forcing, and observation setup. |
bluemath_tk/wrappers/_base_wrappers.py |
Modifies template rendering during case builds. |
bluemath_tk/core/plotting/scatter.py |
Adds selectable variables and color-based visualization. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+448
to
+459
| #for template_name in self.templates_name: | ||
| # try: | ||
| # self.render_file_from_template( | ||
| # template_name=template_name, | ||
| # context=case_context, | ||
| # output_filename=op.join(case_dir, template_name), | ||
| # ) | ||
| # except UnicodeDecodeError as _ude: | ||
| # self.copy_files( | ||
| # src=op.join(self.templates_dir, template_name), | ||
| # dst=op.join(case_dir, template_name), | ||
| # ) |
Comment on lines
+232
to
+234
| sf.config["tstop"] = '20100201 000000' | ||
| sf.config["tstart"] = '20100131 000000' | ||
| sf.config["tref"] = '20100131 000000' |
| # epsg=case_context["epsg"], | ||
| #) | ||
|
|
||
| sf = self.sf |
Comment on lines
+265
to
+267
| sf = self.sf | ||
|
|
||
| sf.config["tstop"] = tstop | ||
| sf.config["tstart"] = tstart | ||
| sf.config["dtout"] = 60 | ||
| sf.config["storemeteo"] = 1 | ||
| sf.set_root(root=case_dir, mode="r+") |
| # sf.write_forcing() | ||
|
|
||
| sf.write() | ||
| #sf.write() |
|
|
||
| # Set water level to NaN at dry points | ||
| dry_threshold = 0.05 | ||
| dry_points = df_output["Depth"].round(12) <= dry_threshold |
Comment on lines
111
to
+112
| sf.setup_cn_infiltration( | ||
| dataset_inf.compute(), antecedent_moisture="{0}".format(ant_moisture) | ||
| dataset_inf.compute(), antecedent_moisture="cn" |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.