Skip to content

Commit

Permalink
Deprecated TimingModel.ordered_params.
Browse files Browse the repository at this point in the history
  • Loading branch information
abhisrkckl committed Aug 17, 2023
1 parent 9d874e8 commit 25e95e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ the released changes.
- Third-order Roemer delay terms to ELL1 model
- Made the addition of a TZR TOA (`AbsPhase`) in the `TimingModel` explicit in `Residuals` class.
- Updated `CONTRIBUTING.rst` with the latest information.
- Made `TimingModel.params` and `TimingModel.ordered_params` identical.
- Made `TimingModel.params` and `TimingModel.ordered_params` identical. Deprecated `TimingModel.ordered_params`.
### Added
- Third-order Roemer delay terms to ELL1 model
- Options to add a TZR TOA (`AbsPhase`) during the creation of a `TimingModel` using `ModelBuilder.__call__`, `get_model`, and `get_model_and_toas`
Expand Down
16 changes: 11 additions & 5 deletions src/pint/models/timing_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,18 +500,24 @@ def __getattr__(self, name):
)

@property_exists
def params(self):
def params_ordered(self):
"""List of all parameter names in this model and all its components.
This is the same as `params_ordered`."""
This is the same as `params`."""

# Historically, this was different from `params_ordered` because Python
# Historically, this was different from `params` because Python
# dictionaries were unordered until Python 3.7. Now there is no reason for
# them to be different.

return self.params_ordered
warn(
"`TimingModel.params_ordered` is now deprecated and maybe removed in the future. "
"Use `TimingModel.params` instead. It gives the same output as `TimingModel.params_ordered`.",
DeprecationWarning,
)

return self.params

@property_exists
def params_ordered(self):
def params(self):
"""List of all parameter names in this model and all its components, in a sensible order."""

# Define the order of components in the list
Expand Down

0 comments on commit 25e95e3

Please sign in to comment.