-
Notifications
You must be signed in to change notification settings - Fork 18
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
Improving simulations.py
input options
#111
Conversation
@ilan-tz, please check above to see if this was what we wanted here. If so, I can finalize this to be merged. |
Codecov Report
@@ Coverage Diff @@
## main #111 +/- ##
==========================================
- Coverage 96.19% 96.05% -0.15%
==========================================
Files 36 36
Lines 2209 2206 -3
==========================================
- Hits 2125 2119 -6
- Misses 84 87 +3
Continue to review full report at Codecov.
|
Fix when exception is raised on incompatible decoder / weight options combination
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.
Great job! This will automate the simulations file for future additions to codes, decoders, and noise models, which will make the process scalable.
I made a few small comments and suggestions. One of these is to do away completely with the str_dict, so we don't have to update this as well when we make additions to the above. I have also made a small commit with a change to decoder.py
that fixes when an Exception is raised for some incompatible decoder/weight option combinations.
flamingpy/simulations.py
Outdated
for value in decoder_args.values(): | ||
file.write("%s," % (value)) |
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.
There is a small bug here. Every entry of weight_opts
is placed in a separate column of the output file, which causes the rest of the entries to be shifted to the right relative to the heading, whereas they are supposed to be placed in just one column.
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.
Good catch, thanks, fixed by adding double quotes to that field.
Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>
Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>
Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>
Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>
Co-authored-by: ilan-tz <57886357+ilan-tz@users.noreply.github.com>
Context for changes
simulations.py
has been improved. The input has been simplified to an intuitive set ofcode
,code_args
,noise
, andnoise_args
. As long as those combinations are valid FlamingPy will run error corrections and automatically set up the output file based on inputs.An example run will be
Example usage and tests
Users can now insert only a
code
(with any imaginable args), anoise
(with any imaginable args), and adecoder
(with any imaginable args). As mentioned as long as those combinations are valid FlamingPy will run error corrections and automatically set up the output file based on inputs.As in
Gives
Performance results justifying changes
Workflow actions and tests
test_simulations.py
has been updated to support the new I/O format.Expected benefits and drawbacks
Expected benefits:
simulations.py
. The user no longer need to manually adjust the script for every newly supported code, noise, and decoder, plus any desired argument can be now inserted.Related Github issues
Checklist and integration statements
black
,docformatter
andpylint
configurations.README.md
as needed.CHANGELOG.md
following the template. I recognize that the developers may revisitCHANGELOG.md
and the versioning, and create a Special Release including my changes.