transition-zero / tz-client

A client repository for accessing FEO data programmatically.
https://docs.feo.transitionzero.org
Apache License 2.0
21 stars 4 forks source link

ENH: Improve Asset.search accuracy for longer strings #63

Open joconnor-ecaa opened 7 months ago

joconnor-ecaa commented 7 months ago

Checklist

Migrated from https://github.com/transition-zero/feo-client-examples/issues/10

Reproducible Example

from feo.client import Asset

search_results = Asset.search("Rooppur nuclear power plant", sector="power")
search_results
for asset in search_results:
    print(asset.id, asset.name_primary_en)

Issue Description

Asset.search returns several entries apart from the specific Asset queried.

Output exceeds the [size limit](command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D). Open the full output data[ in a text editor](command:workbench.action.openLargeOutput?ea2641c6-b1c2-4b12-856f-1149a0bd1c76)
PWRURNBGDA0U0 Rooppur nuclear power plant - 2
PWRURNBGDA0U1 Rooppur nuclear power plant - 1
PWRURNRUSA10U0 Rostov nuclear power plant - 1
PWRURNRUSA10U3 Rostov nuclear power plant - 4
PWRURNRUSA10U2 Rostov nuclear power plant - 3
PWRURNRUSA10U1 Rostov nuclear power plant - 2
PWRURNINDA0U0 Tarapur nuclear power plant - 1
PWRURNINDA0U1 Tarapur nuclear power plant - 2
PWRURNINDA0U2 Tarapur nuclear power plant - 4
PWRURNINDA0U3 Tarapur nuclear power plant - 3
PWRURNUKRA1U2 Rivne nuclear power plant - 3
PWRURNUKRA1U3 Rivne nuclear power plant - 4
PWRURNUKRA1U1 Rivne nuclear power plant - 2
PWRURNUKRA1U0 Rivne nuclear power plant - 1
PWRURNINDA7U2 Jaitapur nuclear power plant - 3
PWRURNINDA7U3 Jaitapur nuclear power plant - 4
PWRURNINDA7U0 Jaitapur nuclear power plant - 1
PWRURNINDA7U4 Jaitapur nuclear power plant - 5
PWRURNINDA7U1 Jaitapur nuclear power plant - 2
PWRURNINDA7U5 Jaitapur nuclear power plant - 6
PWRURNHUNA0U5 Paks nuclear power plant - 6
PWRURNJPNA10U3 Ohi nuclear power plant - 4
PWRURNJPNA10U2 Ohi nuclear power plant - 3
PWRURNJPNA10U1 Ohi nuclear power plant - 2
PWRURNJPNA10U0 Ohi nuclear power plant - 1
...
PWRURNPAKA1U1 Chashma nuclear power plant - 2
PWRURNPAKA1U2 Chashma nuclear power plant - 5
PWRURNPAKA1U3 Chashma nuclear power plant - 3
PWRURNPAKA1U4 Chashma nuclear power plant - 4

Expected Behavior

Asset.search with a specific search string is expected to return only the two powerplants that closely match it:

PWRURNBGDA0U0 Rooppur nuclear power plant - 2
PWRURNBGDA0U1 Rooppur nuclear power plant - 1

The 'threshold' for the "fuzzy search' may need to be tightened. The example can be updated to one where the expected values are returned in the meantime.

isabellasoldner commented 4 months ago

related: https://github.com/transition-zero/feo-client/issues/133