-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Enhance NLTE Solver First Guess with Multiple Estimation Methods #2971
Open
rudrakshnalbalwar
wants to merge
3
commits into
tardis-sn:master
Choose a base branch
from
rudrakshnalbalwar:feature
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
*beep* *bop* 14 W293 [*] Blank line contains whitespace
9 G004 [ ] Logging statement uses f-string
3 INP001 [ ] File `tardis/analysis/opacities.py` is part of an implicit namespace package. Add an `__init__.py`.
3 E999 [ ] SyntaxError: Expected an expression
3 W291 [*] Trailing whitespace
2 PIE808 [*] Unnecessary `start` argument in `range`
2 I001 [*] Import block is un-sorted or un-formatted
2 E712 [*] Avoid equality comparisons to `False`; use `if not ...:` for false checks
2 E722 [ ] Do not use bare `except`
2 F811 [ ] Redefinition of unused `monkeysession` from line 6
1 TD005 [ ] Missing issue description after `TODO`
1 E703 [*] Statement ends with an unnecessary semicolon
1 F401 [*] `tardis.tests.test_util.monkeysession` imported but unused
Complete output(might be large): .github/actions/setup_lfs/action.yml:5:8: E999 SyntaxError: Expected an expression
.github/actions/setup_lfs/action.yml:37:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:1:12: E999 SyntaxError: Simple statements must be separated by newlines or semicolons
.github/workflows/lfs-cache.yml:38:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:50:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:58:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:63:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:68:1: W293 [*] Blank line contains whitespace
.github/workflows/lfs-cache.yml:72:1: W293 [*] Blank line contains whitespace
.mailmap:1:38: E999 SyntaxError: Expected an expression
docs/io/grid/how_to_TardisGridTutorial.ipynb:cell 2:1:1: I001 [*] Import block is un-sorted or un-formatted
docs/io/grid/how_to_TardisGridTutorial.ipynb:cell 7:2:74: W291 [*] Trailing whitespace
docs/io/grid/how_to_TardisGridTutorial.ipynb:cell 14:1:47: W291 [*] Trailing whitespace
docs/io/grid/how_to_TardisGridTutorial.ipynb:cell 14:4:46: E703 [*] Statement ends with an unnecessary semicolon
docs/io/grid/how_to_TardisGridTutorial.ipynb:cell 15:2:55: W291 [*] Trailing whitespace
tardis/analysis/opacities.py:1:1: INP001 File `tardis/analysis/opacities.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/grid/tests/test_grid.py:1:1: INP001 File `tardis/grid/tests/test_grid.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/io/model/readers/tests/test_arepo_parser.py:1:1: INP001 File `tardis/io/model/readers/tests/test_arepo_parser.py` is part of an implicit namespace package. Add an `__init__.py`.
tardis/plasma/properties/nlte_rate_equation_solver.py:318:25: G004 Logging statement uses f-string
tardis/plasma/properties/nlte_rate_equation_solver.py:325:25: G004 Logging statement uses f-string
tardis/plasma/properties/nlte_rate_equation_solver.py:584:1: W293 [*] Blank line contains whitespace
tardis/plasma/properties/nlte_rate_equation_solver.py:587:1: W293 [*] Blank line contains whitespace
tardis/plasma/properties/nlte_rate_equation_solver.py:592:1: W293 [*] Blank line contains whitespace
tardis/plasma/properties/nlte_rate_equation_solver.py:594:1: W293 [*] Blank line contains whitespace
tardis/plasma/properties/nlte_rate_equation_solver.py:598:13: E722 Do not use bare `except`
tardis/plasma/properties/nlte_rate_equation_solver.py:601:1: W293 [*] Blank line contains whitespace
tardis/plasma/properties/nlte_rate_equation_solver.py:602:17: E722 Do not use bare `except`
tardis/plasma/properties/nlte_rate_equation_solver.py:604:1: W293 [*] Blank line contains whitespace
tardis/plasma/properties/nlte_rate_equation_solver.py:612:1: W293 [*] Blank line contains whitespace
tardis/transport/montecarlo/tests/conftest.py:14:5: F811 Redefinition of unused `opacity_state_initialize` from line 7
tardis/visualization/tools/tests/test_convergence_plot.py:3:1: I001 [*] Import block is un-sorted or un-formatted
tardis/visualization/tools/tests/test_convergence_plot.py:6:36: F401 [*] `tardis.tests.test_util.monkeysession` imported but unused
tardis/visualization/tools/tests/test_convergence_plot.py:87:24: PIE808 [*] Unnecessary `start` argument in `range`
tardis/visualization/tools/tests/test_convergence_plot.py:111:22: PIE808 [*] Unnecessary `start` argument in `range`
tardis/visualization/tools/tests/test_convergence_plot.py:198:9: E712 Avoid equality comparisons to `False`; use `if not ...:` for false checks
tardis/visualization/tools/tests/test_convergence_plot.py:215:9: E712 Avoid equality comparisons to `False`; use `if not ...:` for false checks
tardis/visualization/tools/tests/test_convergence_plot.py:220:40: F811 Redefinition of unused `monkeysession` from line 6
tardis/workflows/simple_tardis_workflow.py:230:17: G004 Logging statement uses f-string
tardis/workflows/simple_tardis_workflow.py:451:17: G004 Logging statement uses f-string
tardis/workflows/standard_tardis_workflow.py:172:13: G004 Logging statement uses f-string
tardis/workflows/standard_tardis_workflow.py:212:17: G004 Logging statement uses f-string
tardis/workflows/v_inner_solver.py:16:3: TD005 Missing issue description after `TODO`
tardis/workflows/v_inner_solver.py:180:17: G004 Logging statement uses f-string
tardis/workflows/v_inner_solver.py:207:17: G004 Logging statement uses f-string
tardis/workflows/v_inner_solver.py:315:17: G004 Logging statement uses f-string
Found 45 errors.
[*] 23 fixable with the `--fix` option (2 hidden fixes can be enabled with the `--unsafe-fixes` option).
|
Hey @wkerzendorf , @andrewfullard , @DeerWhale , @atharva-2001 |
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.
📝 Description
Type: 🚀
feature
Overview
This PR improves the NLTE solver by introducing multiple approaches for computing the first guess for ion number densities and electron density. Previously, the solver assumed all ions were singly ionized as the initial guess. Now, additional methods are supported to improve accuracy and robustness.
fixes #2486
Key Changes
✅ Added multiple methods for computing the first guess:
Singly ionized assumption (default): Maintains existing behavior.
LU decomposition: Uses a one-iteration result from a linearized solver for a better estimate.
Previous solution reuse: Uses results from a prior iteration if available.
Auto mode: Automatically cycles through methods, switching if one fails.
✅ Implemented a fallback mechanism
If one method fails, the solver tries another to prevent failures.
📌 Resources
Examples, notebooks, and links to useful references.
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label