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

add prediction feature for shieldhit #172

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

leskiw77
Copy link

@@ -8,6 +8,7 @@

from mcpartools.mcengine.common import EngineDiscover
from mcpartools.scheduler.common import SchedulerDiscover
from progress.bar import ChargingBar
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add try/catch

output_wildcard = "*.bdo"
max_predicted_job_number = 750
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract to some configuration file

output_wildcard = "*.bdo"
max_predicted_job_number = 750
smallCollectFileCoef = (3 * 15 / 125000000.0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also should go to configuration

config_string = cfg_rs.decode('ascii')
config.read_string(config_string)
try:
return config["SHIELDHIT"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better config.get("SHIELDHIT") ? It should return None if key is missing

This comment was marked as outdated.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it is not a dictionary and it is not possible to do this that smoothly.

for line in detect:
if line[0] == "*":
i = 0
if i % 4 == 1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add many comments in this method

if collect_type == "mv":
collect_time = float(self.config['MV_COLLECT_TIME'])
elif self.files_size[0] < 10:
collect_time = 5 + 15 * (jobs_no ** 3) / 125000000
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are these constants ?

@Kudyyy
Copy link

Kudyyy commented Nov 23, 2018

PyCQA/pycodestyle#197
W504 should be ignored

@codecov
Copy link

codecov bot commented Nov 25, 2018

Codecov Report

Merging #172 into master will decrease coverage by 4.21%.
The diff coverage is 30.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
- Coverage   59.15%   54.93%   -4.22%     
==========================================
  Files          13       13              
  Lines         923     1083     +160     
  Branches      150      174      +24     
==========================================
+ Hits          546      595      +49     
- Misses        315      418     +103     
- Partials       62       70       +8
Impacted Files Coverage Δ
mcpartools/generatemc.py 75.6% <100%> (+1.25%) ⬆️
mcpartools/generator.py 55.76% <26.19%> (-7.49%) ⬇️
mcpartools/mcengine/shieldhit.py 44.52% <27.88%> (-10.76%) ⬇️
mcpartools/mcengine/mcengine.py 55.1% <50%> (-0.46%) ⬇️
mcpartools/mcengine/fluka.py 88.88% <62.5%> (-3.3%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e393eea...9064c30. Read the comment docs.

@grzanka
Copy link
Collaborator

grzanka commented Nov 27, 2018

PyCQA/pycodestyle#197
W504 should be ignored

See https://github.com/DataMedSci/pymchelper/blob/76e9244553c803891571b83f80ae82f21bc08ae2/tox.ini#L57

@Kudyyy In tox.ini you can add sth like

[flake8]
exclude = .tox,*.egg,build,_vendor,data,docs/conf.py
ignore = W503
select = E,W,F
max-line-length = 120

counter = 0
with open(detect_file, 'r') as detect: # calculate sizes and number of entries
for line in detect:
if line[0] == "*": # new entry in detect.dat
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* is just a comment character, it doesn't mean that new entry would appear.
*----0---><----1---><----2---><----3---><----4---><----5---><----6---> is just added for convenience.
Two files qouted below are valid and produce same output:

*----0---><----1---><----2---><----3---><----4---><----5---><----6--->
CYL              0.0       0.0       0.0      50.0       7.0      20.0
                 100         1       400        -1       DDD      dose_all
*----0---><----1---><----2---><----3---><----4---><----5---><----6--->
CYL              0.0       0.0       0.0      50.0       7.0      20.0
                 100         1       400        25       DDD      dose_z1
                   1        -1
*----0---><----1---><----2---><----3---><----4---><----5---><----6--->
CYL              0.0       0.0       0.0       5.0       7.0      20.0
                1000         1       400        -1       DDD      dose_all_zoom
*----0---><----1---><----2---><----3---><----4---><----5---><----6--->
CYL              0.0       0.0       0.0       5.0       7.0      20.0
                1000         1       400        25       DDD      dose_z1_zoom

and

CYL              0.0       0.0       0.0      50.0       7.0      20.0
                 100         1       400        -1       DDD      dose_all
CYL              0.0       0.0       0.0      50.0       7.0      20.0
                 100         1       400        25       DDD      dose_z1
                   1        -1
CYL              0.0       0.0       0.0       5.0       7.0      20.0
                1000         1       400        -1       DDD      dose_all_zoom
CYL              0.0       0.0       0.0       5.0       7.0      20.0
                1000         1       400        25       DDD      dose_z1_zoom

logger.debug("Found {0} in detect.dat".format(scoring))
if scoring == "GEOMAP":
count = False
if i % 4 == 2 and count: # Calculate size of entry and increment counter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about DCYL card ?

@reviewpad reviewpad bot mentioned this pull request Mar 28, 2023
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants