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

No nnfabrik core #132

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

KonstantinWilleke
Copy link
Collaborator

@KonstantinWilleke KonstantinWilleke commented Jan 13, 2022

It is time. Let's get rid of nnfabrik_core.

This PR would make the use of nnfabrik more straightforward. Now all that is needed to import all main tables would be these lines:

from nnfabrik import my_nnfabrik

main_nnfabrik, Fabrikant, Dataset, Model, Trainer, Seed = my_nnfabrik(
    schema="nnfabrik_neural_prediction_challenge",
    use_common_fabrikant=False,
    return_main_tables=True,
)

@main_nnfabrik.schema
class TrainedModel(TrainedModelBase):
    table_comment = "Trained models"
    nnfabrik = main_nnfabrik

Before that, the cleanest way to import all tables was this:

main_nnfabrik = my_nnfabrik(
    schema="nnfabrik_neural_prediction_challenge",
    use_common_fabrikant=False,
)

Fabrikant, Dataset, Model, Trainer, Seed = map(
    main_nnfabrik.__dict__.get, ["Fabrikant", "Dataset", "Model", "Trainer", "Seed"]
)


@main_nnfabrik.schema
class TrainedModel(TrainedModelBase):
    table_comment = "Trained models"
    nnfabrik = main_nnfabrik

@KonstantinWilleke
Copy link
Collaborator Author

Change Documentation along with it. (Arne's comment)

@KonstantinWilleke
Copy link
Collaborator Author

KonstantinWilleke commented Jan 13, 2022

from nnfabrik import my_nnfabrik

# new default
schema, *tables = my_nnfabrik(schema="my_project_schema")
Dataset, ... = tables

# advanced use case
schemas, *tables = my_nnfabrik(
    schema={
        'my_name': ["Fabrikant", "Dataset", "Model", "Trainer" ], 
        'common_name': ["Seed"],
        }
)
Dataset, ... = tables

@christoph-blessing
Copy link
Member

Please request my review again once you made the changes we talked about yesterday.

@ArneNx ArneNx removed their request for review February 10, 2022 13:02
@mohammadbashiri mohammadbashiri removed their request for review February 16, 2022 09:40
@mohammadbashiri
Copy link
Collaborator

Please request my review once the changes are implemented and the PR can be merged into the main branch without problems.

@KonstantinWilleke KonstantinWilleke removed the request for review from eywalker February 16, 2022 10:22
@KonstantinWilleke KonstantinWilleke marked this pull request as draft February 16, 2022 10:22
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.

3 participants