From 5f718eb6f8d43e38f57738127ebd5353e7a6c5b1 Mon Sep 17 00:00:00 2001 From: Connor Moreno Date: Thu, 27 Jun 2024 17:49:04 -0500 Subject: [PATCH 1/2] Change tuples of kwargs to lists --- parastell/invessel_build.py | 8 ++++---- parastell/magnet_coils.py | 2 +- parastell/source_mesh.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/parastell/invessel_build.py b/parastell/invessel_build.py index 92928a28..32016ad8 100644 --- a/parastell/invessel_build.py +++ b/parastell/invessel_build.py @@ -101,9 +101,9 @@ def __init__( self.num_rib_pts = 67 self.scale = m2cm - for name in kwargs.keys() & ( + for name in kwargs.keys() & [ 'repeat', 'num_ribs', 'num_rib_pts', 'scale' - ): + ]: self.__setattr__(name,kwargs[name]) self.Surfaces = {} @@ -577,9 +577,9 @@ def __init__( self.radial_build = radial_build self.split_chamber = split_chamber - for name in kwargs.keys() & ( + for name in kwargs.keys() & [ 'plasma_mat_tag', 'sol_mat_tag', 'chamber_mat_tag' - ): + ]: self.__setattr__(name,kwargs[name]) self._logger.info( diff --git a/parastell/magnet_coils.py b/parastell/magnet_coils.py index 70a747f2..0281586b 100644 --- a/parastell/magnet_coils.py +++ b/parastell/magnet_coils.py @@ -58,7 +58,7 @@ def __init__( self.scale = m2cm self.mat_tag = 'magnets' - for name in kwargs.keys() & ('start_line', 'sample_mod', 'scale', 'mat_tag'): + for name in kwargs.keys() & ['start_line', 'sample_mod', 'scale', 'mat_tag']: self.__setattr__(name,kwargs[name]) cubit_io.init_cubit() diff --git a/parastell/source_mesh.py b/parastell/source_mesh.py index 113be874..465d8b76 100644 --- a/parastell/source_mesh.py +++ b/parastell/source_mesh.py @@ -95,7 +95,7 @@ def __init__( self.scale = m2cm - for name in kwargs.keys() & ('scale'): + for name in kwargs.keys() & ['scale']: self.__setattr__(name,kwargs[name]) self.strengths = [] From 47aa2fb839ba2cdc12653392fe37fb5d16a0e9eb Mon Sep 17 00:00:00 2001 From: Connor Moreno Date: Thu, 27 Jun 2024 19:40:22 -0500 Subject: [PATCH 2/2] Revert to tuples, adding a trailing comma for SourceMesh --- parastell/invessel_build.py | 8 ++++---- parastell/magnet_coils.py | 2 +- parastell/source_mesh.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/parastell/invessel_build.py b/parastell/invessel_build.py index 32016ad8..92928a28 100644 --- a/parastell/invessel_build.py +++ b/parastell/invessel_build.py @@ -101,9 +101,9 @@ def __init__( self.num_rib_pts = 67 self.scale = m2cm - for name in kwargs.keys() & [ + for name in kwargs.keys() & ( 'repeat', 'num_ribs', 'num_rib_pts', 'scale' - ]: + ): self.__setattr__(name,kwargs[name]) self.Surfaces = {} @@ -577,9 +577,9 @@ def __init__( self.radial_build = radial_build self.split_chamber = split_chamber - for name in kwargs.keys() & [ + for name in kwargs.keys() & ( 'plasma_mat_tag', 'sol_mat_tag', 'chamber_mat_tag' - ]: + ): self.__setattr__(name,kwargs[name]) self._logger.info( diff --git a/parastell/magnet_coils.py b/parastell/magnet_coils.py index 0281586b..70a747f2 100644 --- a/parastell/magnet_coils.py +++ b/parastell/magnet_coils.py @@ -58,7 +58,7 @@ def __init__( self.scale = m2cm self.mat_tag = 'magnets' - for name in kwargs.keys() & ['start_line', 'sample_mod', 'scale', 'mat_tag']: + for name in kwargs.keys() & ('start_line', 'sample_mod', 'scale', 'mat_tag'): self.__setattr__(name,kwargs[name]) cubit_io.init_cubit() diff --git a/parastell/source_mesh.py b/parastell/source_mesh.py index 465d8b76..0c94ad1f 100644 --- a/parastell/source_mesh.py +++ b/parastell/source_mesh.py @@ -95,7 +95,7 @@ def __init__( self.scale = m2cm - for name in kwargs.keys() & ['scale']: + for name in kwargs.keys() & ('scale',): self.__setattr__(name,kwargs[name]) self.strengths = []