LSSTDESC / descwl-shear-sims

simple simulations for testing weak lensing shear measurement
BSD 3-Clause "New" or "Revised" License
10 stars 9 forks source link

argument after keywords with defaults #205

Open esheldon opened 8 months ago

esheldon commented 8 months ago

Didn't even know this was legal, need to fix this while maintaining backwards compat

https://github.com/LSSTDESC/descwl-shear-sims/blame/3990880af4976a25a0e205df290d8df6d0d66067/descwl_shear_sims/sim.py#L267

beckermr commented 8 months ago

It is due to the * at the start of the function signature. That entry is interpreted as a required keyword without a default AFAIK.

esheldon commented 8 months ago

thanks for the explanation.

I guess we can just leave it then

beckermr commented 8 months ago

I would not leave it IMHO. That keyword should come first in the list at minimum for clarity.

mr-superonion commented 8 months ago

I set it to None by default: https://github.com/LSSTDESC/descwl-shear-sims/blob/4f90565c5e6a74e70d2dbc9fd0cdffd96be41530/descwl_shear_sims/sim.py#L307 and change it to WORD_ORIGIN if it is None: https://github.com/LSSTDESC/descwl-shear-sims/blob/4f90565c5e6a74e70d2dbc9fd0cdffd96be41530/descwl_shear_sims/sim.py#L398-L399

mr-superonion commented 8 months ago

In the future, we will enable user to input se_wcs. Let's open new issue for that.