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

Simplify the constructor for Sinequa class #17

Closed
Tracked by #14
NISH1001 opened this issue Oct 9, 2023 · 0 comments · Fixed by #18
Closed
Tracked by #14

Simplify the constructor for Sinequa class #17

NISH1001 opened this issue Oct 9, 2023 · 0 comments · Fixed by #18
Assignees
Labels
enhancement New feature or request

Comments

@NISH1001
Copy link
Collaborator

NISH1001 commented Oct 9, 2023

Description

Currently pynequa.core.Sinequa class can only be initialized from a config dict. I propose moving the config-based construction to a new classmethod and use barebone parameters as a primary constructor

class Sinequa(API):
    def __init__(self, app_name=<default?>, query_name=<default?>, ..., debug: bool = False):
        pass

    @classmethod
    def from_config(cls, cfg: dict) -> Sinequa:
        pass

Why

Because we want more nuanced control of the construction without having to know what goes in the config. Normally config-based classes are initialized through secondary constructor

@NISH1001 NISH1001 assigned NISH1001 and anisbhsl and unassigned NISH1001 Oct 9, 2023
@NISH1001 NISH1001 added the enhancement New feature or request label Oct 9, 2023
@anisbhsl anisbhsl linked a pull request Oct 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants