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

Unit tests for plot module #292

Open
castillohair opened this issue Jul 17, 2018 · 1 comment
Open

Unit tests for plot module #292

castillohair opened this issue Jul 17, 2018 · 1 comment

Comments

@castillohair
Copy link
Collaborator

I can think of two levels of unit tests for this module:

  1. Successful run tests: Call different plotting functions with different options, and make sure that the respective functions don't crash. These tests would bring some protection against future incompatibilities, particularly with matplotlib.
  2. Result correctness tests: Call different plotting functions with different options, and make sure that the resulting plots are correct.

Ideally we would implement result correctness tests. However, we haven't figured out how to best do this yet.

@castillohair
Copy link
Collaborator Author

In #289 and #290 it was proposed that something similar to the following script:

import FlowCal

d = FlowCal.io.FCSData('Data002.fcs')
d = FlowCal.transform.to_rfi(d)

for scale in ['linear', 'log', 'logicle']:
    # hist1d
    FlowCal.plot.hist1d(d,
                        channel='FL1',
                        xscale=scale,
                        savefig='hist_{}.png'.format(scale))

    # density2d
    FlowCal.plot.density2d(d,
                           mode='scatter',
                           channels=['FSC', 'SSC'],
                           xscale=scale,
                           yscale=scale,
                           savefig='density2d_{}.png'.format(scale))

    # scatter
    FlowCal.plot.scatter2d(d,
                           channels=['FL1', 'FL3'],
                           xscale=scale,
                           yscale=scale,
                           savefig='scatter2d_{}.png'.format(scale))

be incorporated as successful run tests for the different axis scales and the plotting functions that use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant