Skip to content

A DOI filter in build_subsets.py is a no-op because of an 'or True' #62

Description

@realmarcin

Found reviewing #60, in code that PR does not touch.

scripts/fleet/build_subsets.py:158 reads:

shared={t for t in shared if t.split(":")[0]!="DOI" or True}

The or True makes the condition unconditionally true, so the comprehension rebuilds the set unchanged and no DOI term is ever dropped. Whatever the filter was meant to do, it has not been doing it.

Downstream, line 168 does apply a real DOI filter, but only to the three example terms attached to each edge, not to the edge weight n or the per-vocabulary breakdown by. So shared DOIs are currently counted toward the strength of every Mech pair while being kept out of the examples shown for it.

Two ways to resolve it, and they give different numbers on the graph:

  • Delete line 158 as dead code and accept that DOI co-citations count toward edge weight, which is the behaviour the site has always shipped.
  • Make the filter real, which drops DOI from n and by and would shrink several edges. _fleet/data/fleet_data.json shows DOI contributing to the ProteinTraitsMech-NaturalProductMech and TraitMech-ProteinTraitsMech edges among others.

Needs a decision before either is applied, since the second changes published numbers.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions