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

Discriminability y should allow arbitrary type or make docs more clear #140

Closed
bdpedigo opened this issue Dec 4, 2020 · 10 comments · Fixed by #244
Closed

Discriminability y should allow arbitrary type or make docs more clear #140

bdpedigo opened this issue Dec 4, 2020 · 10 comments · Fixed by #244
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers hyppo.discrim Discriminability testing module

Comments

@bdpedigo
Copy link
Contributor

bdpedigo commented Dec 4, 2020

Is your feature request related to a problem? Please describe.
Currently, the y argument to Discriminability.test(x, y) will raise an error if a vector of strings is passed. The error is just that a string array cannot be cast to float.

The docs currently just say nd.array and don't clarify what type of values are accepted. (See here)

Describe the solution you'd like
I don't see why the y argument needs to be cast to float (here), but maybe I'm missing something? From a quick look at the code I don't think anything would break if you just didn't cast this array. Especially since most of the time, these will be ints, i'd imagine.

Describe alternatives you've considered
If you disagree or I'm wrong, the docs should at least be clarified as to what types are accepted, and a check for that data type in the array seems reasonable.

@bdpedigo bdpedigo added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Dec 4, 2020
@sampan501 sampan501 added the good first issue Good for newcomers label Mar 16, 2021
@sampan501 sampan501 added hyppo.discrim Discriminability testing module and removed bug Something isn't working enhancement New feature or request labels Mar 23, 2021
@ghost
Copy link

ghost commented Dec 9, 2021

@sampan501 Hi, I can modify this if it is still open. Let me know if you want that :)

@sampan501
Copy link
Member

Sure you can!

@sampan501 sampan501 assigned ghost Dec 9, 2021
@ghost
Copy link

ghost commented Dec 11, 2021

Sure you can!

Can provide me with a sample reference on how I should edit the documentation of this particular issue? I highly appreciate that.

@sampan501
Copy link
Member

To approach I would try two things. First I would try remove the casting to floats, which I believe is done here:

x1, self.y = convert_xy_float64(x1, self.y)
, and see if the unit tests build. If so, great you are done? If not you need to edit the documentation.

If you are editing the documentation, you will need to edit lines like this:

to specify the type the inputs in all the methods in hyppo. So you would say ndarray of floats or something like that

@ghost
Copy link

ghost commented Dec 12, 2021

To approach I would try two things. First I would try remove the casting to floats, which I believe is done here:

x1, self.y = convert_xy_float64(x1, self.y)

, and see if the unit tests build. If so, great you are done? If not you need to edit the documentation.
If you are editing the documentation, you will need to edit lines like this:

to specify the type the inputs in all the methods in hyppo. So you would say ndarray of floats or something like that

I edited the documentations. Please let me know if everything is alright.
Just one question: Which unit test should I be running for this? maybe a reference to the file or name of it? Thank you.

@sampan501
Copy link
Member

There isn't really a specific unit test. However there should be a netlify deploy preview and the site should render the documentation correctly. The log in netlify should be without any errors

@ghost
Copy link

ghost commented Dec 12, 2021

@sampan501 The netlify link is the same as the one that the bot provided after the initial commit? Should I check that?

@sampan501
Copy link
Member

Should be the same one, also should be a "deploy-preview" in the checks section

@bdpedigo
Copy link
Contributor Author

Did removing the cast to float not work? I felt that when passing in an array of labels, the labels are often integers or strings but rarely floats, does that make sense?

@sampan501
Copy link
Member

So changing the text in the documentation is more of a temporary fix. I opened #246 to investigate whether not casting to float changes the test statistic and p-value calculations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers hyppo.discrim Discriminability testing module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants