-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: master
Are you sure you want to change the base?
add prediction feature for shieldhit #172
Conversation
mcpartools/generator.py
Outdated
@@ -8,6 +8,7 @@ | |||
|
|||
from mcpartools.mcengine.common import EngineDiscover | |||
from mcpartools.scheduler.common import SchedulerDiscover | |||
from progress.bar import ChargingBar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add try/catch
mcpartools/mcengine/shieldhit.py
Outdated
output_wildcard = "*.bdo" | ||
max_predicted_job_number = 750 |
There was a problem hiding this comment.
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
mcpartools/mcengine/shieldhit.py
Outdated
output_wildcard = "*.bdo" | ||
max_predicted_job_number = 750 | ||
smallCollectFileCoef = (3 * 15 / 125000000.0) |
There was a problem hiding this comment.
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
mcpartools/mcengine/shieldhit.py
Outdated
config_string = cfg_rs.decode('ascii') | ||
config.read_string(config_string) | ||
try: | ||
return config["SHIELDHIT"] |
There was a problem hiding this comment.
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.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
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.
mcpartools/mcengine/shieldhit.py
Outdated
for line in detect: | ||
if line[0] == "*": | ||
i = 0 | ||
if i % 4 == 1: |
There was a problem hiding this comment.
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
mcpartools/mcengine/shieldhit.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are these constants ?
PyCQA/pycodestyle#197 |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
See https://github.com/DataMedSci/pymchelper/blob/76e9244553c803891571b83f80ae82f21bc08ae2/tox.ini#L57 @Kudyyy In tox.ini you can add sth like
|
mcpartools/mcengine/shieldhit.py
Outdated
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 |
There was a problem hiding this comment.
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
mcpartools/mcengine/shieldhit.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about DCYL
card ?
#171