Alcampopiano / hypothesize

Robust statistics in Python
https://alcampopiano.github.io/hypothesize/
BSD 3-Clause "New" or "Revised" License
62 stars 3 forks source link

Functionality issues - JOSS review #4

Closed martinagvilas closed 4 years ago

martinagvilas commented 4 years ago

This issue outlines some minor code issues in Hypothesize as part of the review for JOSS.

  1. [x] There is an error with the tr keyword argument of the trim_mean() function when using it as described in the API documentation. For example, when running trim_mean(df, tr=.2) I get:

    TypeError: trim_mean() got an unexpected keyword argument 'tr' 

    I believe this happens because Hypothesize is directly using the trim_mean() method from scipy whose keyword argument in this case is proportiontocut and not tr.

  2. [x] When using functions like bootdpci that take a list of positional arguments (*args), those parameters documented before the *args list cannot be passed as keyword arguments. In the case of bootdpci, for example, x and est cannot be passed as keyword arguments since tr cannot be passed as a keyword argument.

If for both point 1) and 2) the intention is that users of Hypothesize only specify parameters using positional arguments, it would be useful to have this requirement explicit somewhere in the documentation.

Not necessarily for this review but for a later stage in the development of Hypothesize, it would be a nice addition to add tests that assert that keyword arguments are behaving as expected.

Alcampopiano commented 4 years ago

Hello @martinagvilas

I have addressed the issues as follows.

  1. Great catch! I have updated the docs to reflect Scipy's trim_mean arguments exactly. Now proportiontocut is indicated as the positional argument.

  2. I have indicated in the documentation (and docstrings) where positional arguments are required (the docs should be live soon).

Thank you again, and feel free to reopen if anything is unclear.