Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QS: Output Schema #972

Open
wants to merge 7 commits into
base: quantumstrand
Choose a base branch
from
Open

Conversation

ooprathamm
Copy link
Contributor

@ooprathamm ooprathamm commented Mar 14, 2024

Closes #721

@ooprathamm
Copy link
Contributor Author

ooprathamm commented Mar 14, 2024

  • ResultDocument could act as output scheme, that is used by render_strings() or to dump json

  • For Merging the database keys (Idea for discussion):
    • Migrate Databases from struct to pydantic model

    • Sequence of Database objects in TaggedStrings populated by taggers

       Database = Union[ StringGlobalPrevalenceDatabase, OpenSourceStringDatabase....]

       class TaggedString:
           metadb: Sequence[Database]

Make query_fn used by tagger return tag and instance

def query_fn(db: Database, string: str) -> Tuple[Sequence[str], Sequence[Database]]:
    if db.query(string):
        return ("#tag",), [db.query]
    return (), []

In tag_strings update tag and instance

            for tagger in taggers:
                tags, db = tagger(string.string)
                tags.update(tags)
                db_keys.extend(db)

@ooprathamm ooprathamm marked this pull request as draft March 15, 2024 07:53
@mr-tz
Copy link
Collaborator

mr-tz commented Mar 16, 2024

ResultDocument could act as output scheme, that is used by render_strings() or to dump json

That should be the goal; to have one data source used by various output modes.

Migrate Databases from struct to pydantic model

Any formalization like that would be great.

@ooprathamm ooprathamm marked this pull request as ready for review March 17, 2024 08:36
@ooprathamm ooprathamm marked this pull request as draft March 17, 2024 18:17
@ooprathamm ooprathamm marked this pull request as ready for review March 18, 2024 05:59
@mr-tz
Copy link
Collaborator

mr-tz commented Mar 19, 2024

Thanks, will review this in the upcoming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants