Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mafshari64 committed Jul 31, 2024
1 parent 05cf228 commit a3bc981
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ class BSI(FieldIonization):

MODEL_NAME: str = "BSI"

BSI_extensions: list[BSIExtension]
BSI_extensions: tuple[BSIExtension]
"""extension to the BSI model"""

def get_as_pypicongpu(self) -> pypicongpu.species.constant.ionizationmodel.IonizationModel:
if self.BSI_extensions == []:
return ionizationmodel.BSI(ionization_current=None_())

if self.BSI_extensions == [BSIExtension.StarkShift]:
return ionizationmodel.BSIStarkShifted(ionization_current=None_())
if self.BSI_extensions == [BSIExtension.EffectiveZ]:
return ionizationmodel.BSIEffectiveZ(ionization_current=None_())

if len(self.BSI_extensions) > 1:
pypicongpu.util.unsupported("more than one BSI_extension")
else:
pypicongpu.util.unsupported(f"unknown BSI_extension {self.BSI_extensions[0]}")

if self.BSI_extensions[0] is BSIExtension.StarkShift:
return ionizationmodel.BSIStarkShifted(ionization_current=None_())
if self.BSI_extensions[0] is BSIExtension.EffectiveZ:
return ionizationmodel.BSIEffectiveZ(ionization_current=None_())
raise ValueError("unknown BSI extension")
2 changes: 1 addition & 1 deletion lib/python/picongpu/picmi/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def write_input_file(

def picongpu_add_custom_user_input(self, custom_user_input: pypicongpu.customuserinput.InterfaceCustomUserInput):
"""add custom user input to previously stored input"""
self.picongpu_custom_user_input = (self.picongpu_custom_user_input + []) + [custom_user_input]
self.picongpu_custom_user_input = (self.picongpu_custom_user_input or []) + [custom_user_input]

def add_interaction(self, interaction) -> None:
pypicongpu.util.unsupported(
Expand Down
4 changes: 2 additions & 2 deletions lib/python/picongpu/pypicongpu/species/constant/constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def __eq__(self, other) -> bool:
if key not in other.__dict__:
return False

for key, value in self.__dict__:
if self.value != other.__dict__[key]:
for key, value in self.__dict__.items():
if value != other.__dict__[key]:
return False

return True
Expand Down

0 comments on commit a3bc981

Please sign in to comment.