-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Conversion of enlisted variable to int64 datatype #1420
Conversion of enlisted variable to int64 datatype #1420
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1420 +/- ##
=======================================
Coverage 71.16% 71.16%
=======================================
Files 67 67
Lines 5521 5521
=======================================
Hits 3929 3929
Misses 1592 1592 Continue to review full report at Codecov.
|
Thanks for your contribution! Please edit this pull request following the PR template that appears on github when you make a PR. You should read the documentation for running unit tests locally to make sure they pass before making a PR. |
@@ -127,16 +127,16 @@ def montecarlo_main_loop( | |||
""" | |||
output_nus = np.empty_like(packet_collection.packets_output_nu) | |||
last_interaction_types = ( | |||
np.ones_like(packet_collection.packets_output_nu) * -1 | |||
np.ones_like(packet_collection.packets_output_nu).astype(np.int64) * -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.
You can use the dtype=np.int64
keyword argument in the array definition, instead of recasting the array to int64.
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.
Sure understood ... I wanted to know that if I usedtype=np.int64
& if I used astype(np.int64)
what is the main difference that may occur in the execution of the loop & hence generation of results? 🤔
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.
Honestly, I don't know! I recommend investigating yourself. I suggest the dtype
kwarg because it is part of the array creation rather than acted upon the array, so there may be an order-of-operations performance impact.
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.
Sure, I will check it out & convey it here too 😄 ... went with the astype
modification as the variables here so as to follow the same pattern 😓
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.
So on that line, there is not an array being created, so they have to be recast to a new data type using astype
. When an array is created in numpy, you can specify the dtype
at creation time.
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.
Awesome, I had read about this 😄 ... Thank You very much for clarifying this ... Makes a lot of sense :)
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.
It's ready now!! ... please do let me know anything I can help with :)
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.
Hello,
I found this & does look like a complete good explanation for the difference
81d5307
to
5650dfd
Compare
ae97e67
to
98baa39
Compare
/azp run TARDIS refdata |
No pipelines are associated with this pull request. |
/azp run compare-refdata |
Azure Pipelines successfully started running 1 pipeline(s). |
FYI I am running a test suite we have, don't worry about the results |
I will try to solve some more issues :) ... Thank you very much @andrewfullard for the awesome insight for the usage of Though I do have to share my insights too on the difference between the two :P |
Build succeeded 9fd1587 |
This PR aims to fix #1389, change of data type of the enlisted variables of enlisted
Description
float64
toint64
Motivation and Context
Solving #1389
How Has This Been Tested?
Checking the changes through local test too 😄
Ran on
tardis
env created throughtardis3_env.yml
Changes the data type of the main variables in
Montecarlo simulation runner
Screenshots (if appropriate):
Types of changes
Checklist: