Skip to content

Commit

Permalink
Merge pull request nanograv#1702 from abhisrkckl/validation
Browse files Browse the repository at this point in the history
Component validation for WaveX and DMWaveX
  • Loading branch information
dlakaplan authored Jan 17, 2024
2 parents 216e7e6 + 26a5a44 commit c50630d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ the released changes.
- Fixed `derived_params` when OMDOT has 0 uncertainty
- `model.find_empty_masks` will now also look at DMX and SWX parameters
- Fixed `make_fake_toas_fromtim`
- Better exceptions for unsupported/unimplemented binary models (BTX, MSS, etc.)
- Use `Hessian` instead of `Hessdiag` in `DownhillFitter._fit_noise`; compute noise parameter uncertainties only once in `DownhillFitter.fit_toas`.
- Consistent naming in `TimingModel.get_params_mapping()`
- Better exceptions for unsupported/unimplemented binary models (BTX, MSS, etc.)
- Emit warnings when `WaveX`/`DMWaveX` is used together with other representations of red/DM noise
### Removed
12 changes: 8 additions & 4 deletions src/pint/models/timing_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,15 +491,19 @@ def num_components_of_type(type):

from pint.models.dispersion_model import DispersionDMX
from pint.models.wave import Wave
from pint.models.wavex import WaveX
from pint.models.dmwavex import DMWaveX
from pint.models.noise_model import PLRedNoise, PLDMNoise

if num_components_of_type((DispersionDMX, PLDMNoise)) > 1:
if num_components_of_type((DispersionDMX, PLDMNoise, DMWaveX)) > 1:
log.warning(
"DispersionDMX and PLDMNoise are being used together. They are two ways of modelling the same effect."
"DispersionDMX, PLDMNoise, and DMWaveX cannot be used together. "
"They are ways of modelling the same effect."
)
if num_components_of_type((Wave, PLRedNoise)) > 1:
if num_components_of_type((Wave, WaveX, PLRedNoise)) > 1:
log.warning(
"Wave and PLRedNoise are being used together. They are two ways of modelling the same effect."
"Wave, WaveX, and PLRedNoise cannot be used together. "
"They are ways of modelling the same effect."
)

# def __str__(self):
Expand Down

0 comments on commit c50630d

Please sign in to comment.