Closed johnbradley closed 2 years ago
I think there is a problem with term_freqs()
.
With the current changes there is an issue with passing an array of as
values to term_freqs()
.
The /similarity/frequency
endpoint has a new required value of type
that only takes a single value.
There are I think only two ways to fix this:
as
parameter to be a single value, and if in following the previous API a list is supplied, stop()
if they're not all of the same value or if they are, change to that value.as
. (This would only be needed if as
is provided as a list of terms and they are not all the same.) Then process each chunk and finally re-assemble the list.Having 2 would be nice. But one could consider 1 to be a first step in that direction by allowing as
to be a vector, with the caveat that the values not all being the same is not yet supported.
BTW is the following still true? I thought not?
BTW is the following still true? I thought not?
Based on the new type
parameter for/similarity/frequency
that allows either phenotype
and anatomical_entity
I would assume not.
Blame says this commit was added via https://github.com/phenoscape/rphenoscape/commit/330fc7de9ebdce92f623409c736154a317d2abed. I read through the referenced issues but am unsure what might have been the source of this code. Perhaps https://github.com/phenoscape/phenoscape-kb-services/issues/146#issuecomment-503371665.
@johnbradley are you still working on this? It looks ready to merge?
@hlapp I think the code is good now, but the documentation still needs work.
@hlapp Could you take a look at updating the documentation for term_freq()
and corpus_size()
?
@hlapp Are you good with me merging the commits as they are or should I rebase/squash them?
Let's leave the commits, I think most of them make sense on their own.
Changes
phenoscape_api()
to returnhttps://dev.phenoscape.org/api/v2-beta
. Fixes issue withanatomy_ontology_iris()
returning PATO, and ZP. Fixes errors with Resnik simlarity by removing sampling that occasionally caused problems. Updates tests now that the KB API returns classification data in term info response. Adds "states" to thecorpus
parameter forcorpus_size()
andterm_freqs()
.Fixes #243 Fixes #245 Fixes #246