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

Refactor Reclass constructor classmethods #104

Merged
merged 2 commits into from
Feb 26, 2024
Merged

Conversation

simu
Copy link
Member

@simu simu commented Feb 23, 2024

This is a breaking change for users that switched to the Reclass.from_config() constructor classmethod which was introduced in #92.

This PR renames the existing Reclass.from_config() classmethod to Reclass.from_config_file() and introduces a new classmethod Reclass.from_config() which initializes a Reclass instance from an already initialized Config instance.

Checklist

  • The PR has a meaningful title. The title will be used to auto generate the changelog
  • PR contains a single logical change (to build a better changelog).
  • Update the documentation.
  • Update tests.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency, internal
    as they show up in the changelog
  • Link this PR to related PRs or issues.

@simu simu added the breaking label Feb 23, 2024

This comment was marked as outdated.

@simu simu force-pushed the feat/config-from-dict branch 2 times, most recently from 27425cd to 74c8a01 Compare February 23, 2024 15:22
@simu simu force-pushed the feat/reclass-from-config branch from d4497ad to 3f11177 Compare February 23, 2024 15:30

This comment was marked as outdated.

@simu simu requested a review from a team February 23, 2024 17:00
Base automatically changed from feat/config-from-dict to main February 26, 2024 09:31
@simu simu force-pushed the feat/reclass-from-config branch from 3f11177 to a811cd0 Compare February 26, 2024 09:31

This comment was marked as outdated.

simu added 2 commits February 26, 2024 11:17
We rename `Reclass.from_config()` to `Reclass.from_config_file()` and
introduce a new `Reclass.from_config()` method which creates a `Reclass`
instance from a `Config` instance.
@simu simu force-pushed the feat/reclass-from-config branch from a811cd0 to 4d7236b Compare February 26, 2024 10:17
Copy link

Benchmark for d3da62b

Click to view benchmark
Test Base PR %
Reclass::inventory() multi-threaded 1631.9±119.53µs 1638.9±118.65µs +0.43%
Reclass::inventory() single-threaded 3.6±0.06ms 3.6±0.04ms 0.00%

@simu simu merged commit 0fff69b into main Feb 26, 2024
18 checks passed
@simu simu deleted the feat/reclass-from-config branch February 26, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants