ContextLab / quail

A python toolbox for analyzing and plotting free recall data
http://cdl-quail.readthedocs.io/en/latest/
MIT License
20 stars 10 forks source link

notice of erroneous argument #84

Open KirstensGitHub opened 6 years ago

KirstensGitHub commented 6 years ago

I've noticed that it's possible to pass arguments that aren't accepted by quail into quail.plot and still get the correct output without any error / warning.

It's really nice that the figure still generates as it should, but perhaps we should notify the user that he or she has passed an argument that is being ignored / is not used or accepted by quail

jeremymanning commented 6 years ago

The code should fail if bad arguments are passed: http://www.martinfowler.com/ieeeSoftware/failFast.pdf

andrewheusser commented 6 years ago

thanks for noting this @KirstensGitHub . The reason why quail doesn't fail when non-quail args are passed is because all non-quail args are passed onto seaborn, and then non seaborn args are passed to matplotlib. This makes the quail API way more flexible, but also less predictable. To deal with this, we could:

  1. throw a warning if non-quail arguments are detected so the user is aware that behavior may be unpredictable
  2. remove support for non-quail arguments, making the API perfectly predictable, but way less flexible.
  3. something else

I'm leaning towards option 1, but open to suggestions.

jeremymanning commented 6 years ago

i think the flexibility is useful, even though this violates the "fail fast" principle. so...let's go with 1. we should tell the user where their arguments are going at least (e.g. along the lines of "the following arguments will be passed to seaborn: ....")