Skip to content

Commit

Permalink
Fix default arguments for physics package classes
Browse files Browse the repository at this point in the history
Signed-off-by: Brianna Major <brianna.major@taloid.khq.kitware.com>
  • Loading branch information
Brianna Major committed Sep 19, 2024
1 parent de5d62b commit b0fd0b4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions hexrd/instrument/physics_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,11 @@ def __init__(self,
sample_material=None,
sample_density=None,
sample_thickness=None,
sample_geometry=None,
pinhole_material=None,
pinhole_density=None,
pinhole_thickness=None,
pinhole_diameter=None,
window_material=None,
window_density=None,
window_thickness=None,
**kwargs
):
self._sample_material = sample_material
self._sample_density = sample_density
Expand Down Expand Up @@ -205,9 +202,9 @@ class HEDPhysicsPackage(AbstractPP):

def __init__(self, **pp_kwargs):
super().__init__(**pp_kwargs)
self._window_material = pp_kwargs['window_material']
self._window_density = pp_kwargs['window_density']
self._window_thickness = pp_kwargs['window_thickness']
self._window_material = pp_kwargs.get('window_material', None)
self._window_density = pp_kwargs.get('window_density', None)
self._window_thickness = pp_kwargs.get('window_thickness', None)

@property
def attributes_to_serialize(self):
Expand Down Expand Up @@ -264,7 +261,7 @@ class HEDMPhysicsPackage(AbstractPP):

def __init__(self, **pp_kwargs):
super().__init__(**pp_kwargs)
self._sample_geometry = pp_kwargs['sample_geometry']
self._sample_geometry = pp_kwargs.get('sample_geometry', None)

@property
def attributes_to_serialize(self):
Expand Down

0 comments on commit b0fd0b4

Please sign in to comment.