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

Initial laydown of comparison plots for TestW7. #566

Merged
merged 3 commits into from
May 24, 2016

Conversation

kdexd
Copy link

@kdexd kdexd commented May 18, 2016

This PR implements a new design pattern - having a plot_foo method in TestW7 class, for each test_foo method. As a first prototype, plot_spectrum has been added.


Checklist holds a track of work done so far and work TODO:

  • Method plot_spectrum to generate a plot for deviation in spectrum.luminosity_density_lambda against spectrum.wavelength is added within.
  • Show whether that test passed or failed within the plot itself (a badge on top right of plot).
  • Enclose assertions in try-except and make suitable calls.
  • Form a directory structure for saving the plots.

Future enhancements

  • Find a way to put in description about build status corresponding to the plots. (pytest-html)
    • Commit hash of build.
    • Starting time, time taken.
    • Number of passes, failures, skips etc.

@kdexd kdexd force-pushed the comparison-plots branch from 1c0d62d to 75e62c6 Compare May 18, 2016 08:32
@kdexd kdexd changed the title Initial laydown of comparison plots for TestW7. [wip] Initial laydown of comparison plots for TestW7. May 18, 2016
@kdexd kdexd force-pushed the comparison-plots branch 6 times, most recently from 4be6db9 to 9365b03 Compare May 24, 2016 08:49
# for different spectrum quantities all in one figure.
ldl_ax = plt.subplot(111)
ldl_ax.set_title("Deviation in luminosity_density_lambda")
ldl_ax.set_xlabel("N-th packet")
Copy link
Contributor

Choose a reason for hiding this comment

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

You are plotting the luminosity density which is used together with the wavelength to form the spectrum.
labeling the x axis N-th packet is wrong.
Plot the data as (x,y) where x is the wavelength and y the luminosity density at that x and call the x-label Wavelength.

@wkerzendorf
Copy link
Member

@yeganer @unoebauer is this mergeable - with the notice that we will change the plots later? Are there any serious issues left?

@kdexd kdexd force-pushed the comparison-plots branch from 9f37a6d to fa303e6 Compare May 24, 2016 12:30
@kdexd kdexd changed the title [wip] Initial laydown of comparison plots for TestW7. Initial laydown of comparison plots for TestW7. May 24, 2016
@unoebauer
Copy link
Contributor

@wkerzendorf, @karandesai-96 - fine with me. The PR looks good and some aesthetic details or additional plotting capabilities can be added later. Merge at will!

@yeganer
Copy link
Contributor

yeganer commented May 24, 2016

@wkerzendorf @unoebauer Yes I think we can merge this (I'd autosquash it because of all the back and forth during the PR)

Karan Desai added 3 commits May 24, 2016 19:51
- A call to this method is made by test_spectrum method
  which asserts spectrum quantities.

- The pass / fail status is mentioned on the plot itself,
  by passing a boolean parameter 'passed' to plot_spectrum.

- plot_spectrum is called in different ways from try and
  except blocks of test_spectrum, for the same.
- Rename obtained_radial1d_model -> result.

- Remove semilog scale from plot due to ValueError.
- Use this fixture in TestW7, by creating per-setup
  subdirectories (currently only W7, would be enhanced
  by parametrization later).

- Directories are named as per git commit hashes.
@kdexd kdexd force-pushed the comparison-plots branch from 39fc5f4 to 20ccf7b Compare May 24, 2016 14:23
@wkerzendorf wkerzendorf merged commit 2d00a54 into tardis-sn:master May 24, 2016
@kdexd kdexd deleted the comparison-plots branch June 23, 2016 03:01
ftsamis pushed a commit to ftsamis/tardis that referenced this pull request Nov 12, 2016
* Add plot_spectrum method in TestW7 class.

- A call to this method is made by test_spectrum method
  which asserts spectrum quantities.

- The pass / fail status is mentioned on the plot itself,
  by passing a boolean parameter 'passed' to plot_spectrum.

- plot_spectrum is called in different ways from try and
  except blocks of test_spectrum, for the same.

* Cosmetic improvements.

- Rename obtained_radial1d_model -> result.

- Remove semilog scale from plot due to ValueError.

* Add fixture for base directory of saving plots.

- Use this fixture in TestW7, by creating per-setup
  subdirectories (currently only W7, would be enhanced
  by parametrization later).

- Directories are named as per git commit hashes.
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