[SPH] fix typo in monofluid naming#1911
Conversation
|
Thanks @tdavidcl for opening this PR! You can do multiple things directly here: Once the workflow completes a message will appear displaying informations related to the run. Also the PR gets automatically reviewed by gemini, you can: |
There was a problem hiding this comment.
Code Review
This pull request renames the monofluid dust mode from TVI to TVA across C++ configurations, Python bindings, and example scripts. To ensure backward compatibility, the feedback suggests supporting the old 'monofluid_tvi' type during JSON deserialization of configuration files and retaining a deprecated 'set_dust_mode_monofluid_tvi' alias in the Python bindings to avoid breaking existing user scripts.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| } else if (type == "monofluid_tva") { | ||
| set_monofluid_tva( | ||
| j.at("ndust").get<u32>(), j.at("pure_diffusion_mode").get<bool>()); |
There was a problem hiding this comment.
To maintain backward compatibility with existing simulation configuration files and checkpoint dumps that contain "type": "monofluid_tvi", we should also accept "monofluid_tvi" and map it to set_monofluid_tva during JSON deserialization.
| } else if (type == "monofluid_tva") { | |
| set_monofluid_tva( | |
| j.at("ndust").get<u32>(), j.at("pure_diffusion_mode").get<bool>()); | |
| } else if (type == "monofluid_tva" || type == "monofluid_tvi") { | |
| set_monofluid_tva( | |
| j.at("ndust").get<u32>(), j.at("pure_diffusion_mode").get<bool>()); |
| .def( | ||
| "set_dust_mode_monofluid_tvi", | ||
| "set_dust_mode_monofluid_tva", | ||
| [](TConfig &self, u32 nvar, bool pure_diffusion_mode) { | ||
| self.dust_config.set_monofluid_tvi(nvar, pure_diffusion_mode); | ||
| self.dust_config.set_monofluid_tva(nvar, pure_diffusion_mode); | ||
| }, |
There was a problem hiding this comment.
To prevent breaking existing Python scripts that call set_dust_mode_monofluid_tvi, we should keep a deprecated alias in the Python bindings that prints a warning and delegates to the new set_dust_mode_monofluid_tva method.
.def(
"set_dust_mode_monofluid_tva",
[](TConfig &self, u32 nvar, bool pure_diffusion_mode) {
self.dust_config.set_monofluid_tva(nvar, pure_diffusion_mode);
},
py::kw_only(),
py::arg("nvar"),
py::arg("pure_diffusion_mode") = false)
.def(
"set_dust_mode_monofluid_tvi",
[](TConfig &self, u32 nvar, bool pure_diffusion_mode) {
ON_RANK_0(shamlog_warn_ln(
"SPH",
".set_dust_mode_monofluid_tvi() is deprecated, please use .set_dust_mode_monofluid_tva() instead."));
self.dust_config.set_monofluid_tva(nvar, pure_diffusion_mode);
},
Workflow reportworkflow report corresponding to commit 92ed469 Pre-commit check reportPre-commit check: ✅ Test pipeline can run. Clang-tidy diff reportDoxygen diff with
|
No description provided.