Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

CU-8699hj2dx Revamp component initialisation#95

Merged
mart-r merged 11 commits intomainfrom
CU-8699hj2dx-revamp-component-init
Jun 25, 2025
Merged

CU-8699hj2dx Revamp component initialisation#95
mart-r merged 11 commits intomainfrom
CU-8699hj2dx-revamp-component-init

Conversation

@mart-r
Copy link
Collaborator

@mart-r mart-r commented Jun 25, 2025

Some of the component initialisation was previously handled in an invonenient way

  • The arguments were set into the config
    • Which would sometimes duplicate them if things aren't handled correctly
  • The arguments had tight coupling with the __init__ method
    • But compatibility wasn't clear (i.e at mypy check time)
  • The arguments were set using the same set of input options
    • Which meant the above 2 were unnecessary

What this PR does

  • Removes all config-based init arguments
    • These shouldn't be needed
    • But also helps avoid duplicated data
  • Introduces a new class method create_new_component as part of the BaseComponent protocol
    • This is used as the entry point as well
    • It simply uses the same arguments that were previously used to get init arguments
    • It can (and often does) delegate to other existing (static) methods
  • Use the above for component init
  • Add some extra documentation regarding manual serialisation init arguments

@mart-r mart-r merged commit 14d4cf2 into main Jun 25, 2025
4 checks passed
mart-r added a commit to CogStack/cogstack-nlp that referenced this pull request Jun 25, 2025
* CU-8699hj2dx: Initial changes to remove config-based init args and hardcode it (WIP)

* CU-8699hj2dx: Update/fix a registration test

* CU-8699hj2dx: Some minor keyword argument renaming

* CU-8699hj2dx: Fix RelCAT tests (init)

* CU-8699hj2dx: Update Transformers NER to work when loading models

* CU-8699hj2dx: Fix DeID deserialising test

* CU-8699hj2dx: Fix MeaCAT init

* CU-8699hj2dx: Fix RelCAT init/load

* CU-8699hj2dx: Remove unused import

* CU-8699hj2dx: Add doc string regarding keyword arguments when manually deserialising

* CU-8699hj2dx: Update pipeline with notes regarding keyword arguments for manual deserialisation
mart-r added a commit to CogStack/cogstack-nlp that referenced this pull request Jun 25, 2025
* CU-8699hj2dx: Initial changes to remove config-based init args and hardcode it (WIP)

* CU-8699hj2dx: Update/fix a registration test

* CU-8699hj2dx: Some minor keyword argument renaming

* CU-8699hj2dx: Fix RelCAT tests (init)

* CU-8699hj2dx: Update Transformers NER to work when loading models

* CU-8699hj2dx: Fix DeID deserialising test

* CU-8699hj2dx: Fix MeaCAT init

* CU-8699hj2dx: Fix RelCAT init/load

* CU-8699hj2dx: Remove unused import

* CU-8699hj2dx: Add doc string regarding keyword arguments when manually deserialising

* CU-8699hj2dx: Update pipeline with notes regarding keyword arguments for manual deserialisation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant