Open jar398 opened 8 years ago
What are you trying to do? I don't use NexsonProxy to get study-level properties. I'd do something like this:
for study_id, studyobj in phy.iter_study_objs():
nexml = get_nexml_el(studyobj)
year = nexml.get('^ot:studyYear')
NexsonProxy does a lot of other things that seem very nice that aren't provided by the raw nexson blob (get_nexml_el), such as structured access to OTUs, trees, edges, and nodes.
"Provides high level wrappers around a Nexson data model blob to let it be treated as if it were a list of OTUs and a list of trees"
If it is useful, then as a matter of design it ought to provide at least as much service as the low-level form, since otherwise people will end up using a mix of the two, which would be confusing. If it is not useful, it should be deleted.
I am trying to rewrite parts of the conflict code (which is in jython and uses Java libraries) so that it looks more like peyotl. (I can't use peyotl directly since it doesn't run in jython.)
@jar398, you can get study-level properties like so:
np = NexsonProxy(nexson=blob)
nexml = np._nexml_el
year = nexml.get('^ot:studyYear')
Would you like a less "private" getter, like np.get_nexml_el()
?
Yes, less private, please, and maybe more abstract (not just exposing the raw json).
such as ^ot:focalClade. or am I missing something?