Skip to content

No nnfabrik core#132

Draft
KonstantinWilleke wants to merge 18 commits intosinzlab:masterfrom
KonstantinWilleke:no_nnfabrik_core
Draft

No nnfabrik core#132
KonstantinWilleke wants to merge 18 commits intosinzlab:masterfrom
KonstantinWilleke:no_nnfabrik_core

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 christoph-blessing removed their request for review January 14, 2022 09:16
@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
Member

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