Skip to content

Commit

Permalink
Fix bug in perturbation.py (#525)
Browse files Browse the repository at this point in the history
### Description
Fix the bug in perturbation.py to compare `f.solenoidal` to both `None`
and `"None"`

### Related issues
Pointed out by sonarcloud

### Checklist
_Before this pull request can be reviewed, all of these tasks should be
completed. Denote completed tasks with an `x` inside the square brackets
`[ ]` in the Markdown source below:_
- [x] I have added a description (see above).
- [ ] I have added a link to any related issues see (see above).
- [x] I have read the [Contributing
Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md).
- [ ] I have added tests for any new physics that this PR adds to the
code.
- [ ] I have tested this PR on my local computer and all tests pass.
- [ ] I have manually triggered the GPU tests with the magic comment
`/azp run`.
- [ ] I have requested a reviewer for this PR.

---------

Co-authored-by: Piyush Sharda <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Piyush Sharda <[email protected]>
Co-authored-by: Piyush Sharda <[email protected]>
Co-authored-by: Ben Wibking <[email protected]>
Co-authored-by: Piyush Sharda <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
8 people authored Feb 5, 2024
1 parent 93686aa commit edc1dbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/perturbation.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def plot_spectrum1D(pertx, perty, pertz):
# data precision
dtype = np.float64
# ratio of solenoidal to compressive components
if options.f_solenoidal is None or options.f_solenoidal is None:
if (options.f_solenoidal is None) or (options.f_solenoidal=="None"):
f_solenoidal = None
else:
f_solenoidal = min(max(float(options.f_solenoidal), 0.), 1.)
Expand Down

0 comments on commit edc1dbc

Please sign in to comment.