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 tests to SDEC plotter module #1752

Merged
merged 19 commits into from
Jan 11, 2022

Conversation

jaladh-singhal
Copy link
Member

@jaladh-singhal jaladh-singhal commented Jul 23, 2021

Adds tests for SDEC plots

Motivation and context

Currently there are no tests for sdec_plot.py due to which we have to rerun notebook to test if plots look ok whenever a change affecting SDEC plots is made.

How has this been tested?

  • Testing pipeline.
  • Other.

Examples

Type of change

  • Bug fix.
  • New feature.
  • Breaking change.
  • None of the above.

Checklist

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • (optional) I have built the documentation on my fork following the instructions.
  • I have assigned and requested two reviewers for this pull request.

@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

Merging #1752 (6336d67) into master (69fac16) will increase coverage by 4.46%.
The diff coverage is n/a.

❗ Current head 6336d67 differs from pull request most recent head eddc6b2. Consider uploading reports for the commit eddc6b2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1752      +/-   ##
==========================================
+ Coverage   57.65%   62.12%   +4.46%     
==========================================
  Files          66       66              
  Lines        6809     6809              
==========================================
+ Hits         3926     4230     +304     
+ Misses       2883     2579     -304     
Impacted Files Coverage Δ
tardis/tardis/simulation/base.py 83.79% <0.00%> (+0.46%) ⬆️
tardis/tardis/visualization/plot_util.py 100.00% <0.00%> (+6.25%) ⬆️
tardis/tardis/montecarlo/montecarlo_numba/base.py 32.14% <0.00%> (+7.14%) ⬆️
tardis/tardis/base.py 75.00% <0.00%> (+17.85%) ⬆️
tardis/tardis/visualization/tools/sdec_plot.py 85.97% <0.00%> (+76.45%) ⬆️

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 69fac16...eddc6b2. Read the comment docs.

@atharva-2001 atharva-2001 mentioned this pull request Nov 25, 2021
10 tasks
Copy link
Member Author

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

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

This is some really impressive work @atharva-2001 🎉

I guess only 2 things are left:

  • testing generate_plot_mpl
  • pushing up test data to tardis-refdata (I guess this is the reason test pipeline is failing?)

@atharva-2001 atharva-2001 force-pushed the sdec-tests branch 2 times, most recently from 4064a23 to 1ee1d42 Compare December 1, 2021 17:40
@atharva-2001 atharva-2001 force-pushed the sdec-tests branch 3 times, most recently from 211ada4 to d2c92be Compare December 11, 2021 09:52
@atharva-2001 atharva-2001 marked this pull request as ready for review December 11, 2021 12:51
@atharva-2001 atharva-2001 force-pushed the sdec-tests branch 4 times, most recently from 9208be0 to 4bad25a Compare December 14, 2021 08:08
@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

Copy link
Member Author

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

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

Excellent work @atharva-2001 - the comments are very helpful for readability and thanks for adding docstrings.

It's ready to be merged once test pipeline passes. We need to debug why ref-data can't be found in pipeline. Meanwhile can you post output of your local tests run?

@jaladh-singhal
Copy link
Member Author

Also the black pipeline fails - can you please fix that @atharva-2001?

@atharva-2001
Copy link
Member

/azp run update-refdata

Copy link
Member Author

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

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

Thanks @atharva-2001 - pipelines pass now!

@@ -277,7 +279,7 @@ def montecarlo_main_loop(
continue
v_packets_energy_hist[idx] += vpackets_energy[j]

if montecarlo_configuration.VPACKET_LOGGING:
if virtual_packet_logging:
for vpacket_collection in vpacket_collections:
Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this requires rebasing?

@jaladh-singhal
Copy link
Member Author

/azp run compare-refdata

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link

Build succeeded 0a1922e

Click here to see results.

name=subgroup_name,
)

self.hdf_file.create_carray(
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it could be a loop

Copy link
Member

@atharva-2001 atharva-2001 Jan 11, 2022

Choose a reason for hiding this comment

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

yes, you're right

@andrewfullard andrewfullard merged commit 8c21bc7 into tardis-sn:master Jan 11, 2022
@atharva-2001 atharva-2001 mentioned this pull request Jan 24, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants