Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restartable models #111

Open
wants to merge 36 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
6cf4162
wip
HDembinski Jan 2, 2023
a85ba34
fix
HDembinski Jan 2, 2023
26c769e
cleanup
HDembinski Jan 2, 2023
9255d40
bug-fix for epos
HDembinski Jan 2, 2023
f904713
cleanup
HDembinski Jan 2, 2023
8a4d1ff
update urqmd reference
HDembinski Jan 2, 2023
af161ce
fix wrong mass for proton,neutron
HDembinski Jan 4, 2023
0213fad
update urqmd reference
HDembinski Jan 4, 2023
c752368
work in progress
HDembinski Dec 31, 2022
1f4982c
ported sibyll
HDembinski Dec 31, 2022
173589e
ported pythia6
HDembinski Dec 31, 2022
baf41b4
ported pythia8
HDembinski Dec 31, 2022
b9b6921
move CompositeTarget to util, use process_particle everywhere
HDembinski Dec 31, 2022
d41a497
port sophia
HDembinski Dec 31, 2022
6372c93
port urqmd
HDembinski Dec 31, 2022
eb88290
ported phojet
HDembinski Jan 1, 2023
ac6fb7d
fixes
HDembinski Jan 1, 2023
c9adb18
fix tests, add MCRun.get_stable, add numpy state to rng state
HDembinski Jan 2, 2023
40d062e
revert name change to test references
HDembinski Jan 2, 2023
0f02a8f
remove obsolete inits
HDembinski Jan 2, 2023
fe45cfe
IT WORKS
HDembinski Jan 2, 2023
632da2d
massive fixes and new tests for cross sections
HDembinski Jan 2, 2023
e8b6963
terminate process if it is still alive
HDembinski Jan 2, 2023
34fd277
kill
HDembinski Jan 3, 2023
b0555d5
fix bug in remote control, add reprs
HDembinski Jan 3, 2023
698e31c
update notebook
HDembinski Jan 3, 2023
2029384
mark bad combinations for cross_section test, allow MCRunRemote to ru…
HDembinski Jan 3, 2023
fd69c9b
fix remotecall
HDembinski Jan 3, 2023
74cc715
fix
HDembinski Jan 3, 2023
fda3574
fix
HDembinski Jan 3, 2023
4f662f1
fix
HDembinski Jan 3, 2023
367d90c
check more stuff
HDembinski Jan 3, 2023
9b401fe
make naming in sibyll more consistent
HDembinski Jan 4, 2023
12ede78
fix my bug introduced to dpmjet
HDembinski Jan 4, 2023
7a2da75
examples
HDembinski Jan 4, 2023
b3ab91c
Merge branch 'main' into singletons
afedynitch Jan 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,183 changes: 29 additions & 3,154 deletions examples/cross_section.ipynb

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ testpaths = ["tests"]
filterwarnings = [
"error::numpy.VisibleDeprecationWarning",
"error::DeprecationWarning",
"ignore::impy.AliveInstanceWarning",
"ignore::impy.FixedStableListWarning",
"ignore::impy.OutputWarning",
]

[tool.cibuildwheel]
Expand Down
12 changes: 11 additions & 1 deletion src/impy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
from impy import kinematics
from impy import constants
import os
from impy.util import AliveInstanceWarning, FixedStableListWarning, OutputWarning

debug_level = int(os.environ.get("DEBUG", "0"))

__all__ = ["models", "kinematics", "constants", "debug_level", "__version__"]
__all__ = [
"models",
"kinematics",
"constants",
"debug_level",
"AliveInstanceWarning",
"FixedStableListWarning",
"OutputWarning",
"__version__",
]
10 changes: 5 additions & 5 deletions src/impy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ def main():
)

if pr > 0 and ta == 0: # fixed target mode
evt_kin = FixedTarget(Momentum(pr), args.projectile_id, args.target_id)
kin = FixedTarget(Momentum(pr), args.projectile_id, args.target_id)
else: # cms mode
evt_kin = CenterOfMass(args.sqrts, args.projectile_id, args.target_id)
kin = CenterOfMass(args.sqrts, args.projectile_id, args.target_id)

task_id = None
try:
model = args.model(evt_kin)
ofile = FORMATS[args.output](args.out, model)
model = args.model(args.seed)
ofile = FORMATS[args.output](args.out, model, kin)
with ofile:
# workaround: several models generate extra print when first
# event is generated, this interferes with progress bar so we
Expand All @@ -344,7 +344,7 @@ def main():
TimeRemainingColumn(elapsed_when_finished=True),
SpeedColumn(),
) as bar:
for event in model(args.number):
for event in model(kin, args.number):
ofile.write(event)
if task_id is None:
task_id = bar.add_task("", total=args.number)
Expand Down
Loading