Skip to content

Commit

Permalink
Updating docstring and some more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise committed Jun 20, 2023
1 parent 9e24f7a commit 8648f3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion openmc/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ def max_order(self, max_order: Optional[int]):
self._max_order = max_order

@property
def source(self) -> typing.List[Source]:
def source(self) -> typing.List[SourceBase]:
return self._source

@source.setter
Expand Down
2 changes: 1 addition & 1 deletion openmc/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class FileSource(SourceBase):
Parameters
----------
path : str or Pathlike
path : str or pathlib.Path
Path to the source file from which sites should be sampled
strength : float
Strength of the source (default is 1.0)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/test_source_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_wrong_source_attributes(run_in_tmpdir):
settings = openmc.Settings()
settings.particles = 100
settings.batches = 10
settings.source = openmc.FileSource(filename='animal_source.h5')
settings.source = openmc.FileSource(path='animal_source.h5')
settings.export_to_xml()

# When we run the model, it should error out with a message that includes
Expand All @@ -90,7 +90,7 @@ def test_source_file_transport(run_in_tmpdir):
sph = openmc.Sphere(r=10.0, boundary_type='vacuum')
cell = openmc.Cell(fill=al, region=-sph)
model.geometry = openmc.Geometry([cell])
model.settings.source = openmc.FileSource(filename='source.h5')
model.settings.source = openmc.FileSource(path='source.h5')
model.settings.particles = 10
model.settings.batches = 3
model.settings.run_mode = 'fixed source'
Expand Down

0 comments on commit 8648f3c

Please sign in to comment.