Closed ortk95 closed 4 months ago
Adds a replace method to objects, to allow e.g. a new Body instance to be created with some parameters replaced:
replace
Body
body = planetmapper.Body('jupiter', '2020-01-01', observer='earth') new = body.replace(utc='2020-01-01T12:34:56', observer='hst') print(body) # Body('JUPITER', '2020-01-01T00:00:00.000000', observer='EARTH') print(new) # Body('JUPITER', '2020-01-01T12:34:56.000000', observer='HST')
This also adds the corresponding __replace__ method to properly interface with the stdlib's copy.replace.
__replace__
copy.replace
requirements.txt
setup.py
run_ci.sh
See CONTRIBUTING.md for more details.
Adds a
replace
method to objects, to allow e.g. a newBody
instance to be created with some parameters replaced:This also adds the corresponding
__replace__
method to properly interface with the stdlib'scopy.replace
.345
Pull request checklist
requirements.txt
are reflected insetup.py
and conda-forge feedstockrun_ci.sh
or check GitHub Actions)See CONTRIBUTING.md for more details.