Git Product home page Git Product logo

Comments (3)

gtdang avatar gtdang commented on July 3, 2024 1

for search_terms, search_dict in search_pairs:
inner_set = set()
# Union of indices which match inputs for single parameter
for term in search_terms:
inner_set = inner_set.union(search_dict.get(term, list()))
# Intersection across parameters
if conn_set and inner_set:
conn_set = conn_set.intersection(inner_set)
# If at any point there's no matching elements, return empty
if not conn_set:
return list()
else:
conn_set = conn_set.union(inner_set)

Tracing the issue... I think lines 291-292 are nested too far in? That if statement can't ever trigger since it's nested in an a conditional where it must be True.

Nevermind I'm incorrect. The intersect can change the set to none. I have a different solution.

from hnn-core.

gtdang avatar gtdang commented on July 3, 2024

for search_terms, search_dict in search_pairs:
inner_set = set()
# Union of indices which match inputs for single parameter
for term in search_terms:
inner_set = inner_set.union(search_dict.get(term, list()))
# Intersection across parameters
if conn_set and inner_set:
conn_set = conn_set.intersection(inner_set)
# If at any point there's no matching elements, return empty
if not conn_set:
return list()
else:
conn_set = conn_set.union(inner_set)

Tracing the issue... I think lines 291-292 are nested too far in? That if statement can't ever trigger since it's nested in an a conditional where it must be True.

from hnn-core.

jasmainak avatar jasmainak commented on July 3, 2024

Fix with an accompanying unit test welcome !

from hnn-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.