Skip to content

Commit

Permalink
fix: wrap doc strings gsparams and image
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Sep 9, 2024
1 parent 7675082 commit 05bdc49
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 144 deletions.
16 changes: 3 additions & 13 deletions jax_galsim/gsparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,8 @@ def from_galsim(cls, gsparams):
)

@staticmethod
@implements(_galsim.GSParams.check)
def check(gsparams, default=None, **kwargs):
"""Checks that gsparams is either a valid GSParams instance or None.
In the former case, it returns gsparams, in the latter it returns default
(GSParams.default if no other default specified).
"""
if gsparams is None:
if default is not None:
if isinstance(default, GSParams):
Expand All @@ -65,10 +61,8 @@ def check(gsparams, default=None, **kwargs):
raise TypeError("Invalid GSParams: %s" % gsparams)
return gsparams.withParams(**kwargs)

@implements(_galsim.GSParams.withParams)
def withParams(self, **kwargs):
"""Return a `GSParams` that is identical to the current one except for any keyword
arguments given here, which supersede the current value.
"""
if len(kwargs) == 0:
return self
else:
Expand All @@ -80,12 +74,8 @@ def withParams(self, **kwargs):
return GSParams(**d)

@staticmethod
@implements(_galsim.GSParams.combine)
def combine(gsp_list):
"""Combine a list of `GSParams` instances using the most restrictive parameter from each.
Uses the minimum value for most parameters. For the following parameters, it uses the
maximum numerical value: minimum_fft_size, maximum_fft_size, stepk_minimum_hlr.
"""
if len(gsp_list) == 1:
return gsp_list[0]
elif all(g == gsp_list[0] for g in gsp_list[1:]):
Expand Down
Loading

0 comments on commit 05bdc49

Please sign in to comment.