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

Implement getters for Reclass.nodes and Reclass.classes #88

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

simu
Copy link
Member

@simu simu commented Jan 27, 2024

This allows Python code to read basic information about the results of the node and classes discovery without having to render the inventory.

the new getters return dicts which map the normalized Reclass entity names (with dots for entities in subdirectories) to the file path associated with the entity.

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

@simu simu added the enhancement New feature or request label Jan 27, 2024

This comment was marked as outdated.

@simu simu force-pushed the feat/compose-node-name branch from f01746d to e8eed26 Compare January 27, 2024 16:34
@simu simu force-pushed the feat/top-level-getters branch from 3fe6c9d to 21c9e8d Compare January 27, 2024 16:35

This comment was marked as outdated.

@simu simu force-pushed the feat/top-level-getters branch from 21c9e8d to cf948be Compare January 27, 2024 16:38
@simu simu force-pushed the feat/compose-node-name branch from 064a524 to 2eab4a3 Compare January 27, 2024 16:40
@simu simu force-pushed the feat/top-level-getters branch from cf948be to 79bf396 Compare January 27, 2024 16:41

This comment was marked as outdated.

@simu simu force-pushed the feat/compose-node-name branch 2 times, most recently from c827bac to 178c9f3 Compare January 27, 2024 18:09
@simu simu force-pushed the feat/top-level-getters branch from 79bf396 to 3111af0 Compare January 27, 2024 18:09

This comment was marked as outdated.

@simu simu force-pushed the feat/compose-node-name branch 2 times, most recently from 523cabb to f41dfca Compare January 30, 2024 14:16
@simu simu force-pushed the feat/compose-node-name branch from f41dfca to 0537541 Compare February 13, 2024 09:53
Base automatically changed from feat/compose-node-name to main February 14, 2024 14:54
@simu simu force-pushed the feat/top-level-getters branch from 3111af0 to 5407ea2 Compare February 14, 2024 14:55
@simu simu marked this pull request as ready for review February 14, 2024 14:55
@simu simu requested a review from a team February 14, 2024 14:55

This comment was marked as outdated.

Copy link
Member

@haasad haasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

expected_nodes = set([f"n{i}" for i in range(1, 26)])

this could also be written as set comprehension:

expected_nodes = {f"n{i}" for i in range(1, 26)}

😉

simu and others added 3 commits February 16, 2024 14:19
This allows Python code to read basic information about the results of
the node and classes discovery without having to render the inventory.

the new getters return dicts which map the normalized Reclass entity
names (with dots for entities in subdirectories) to the file path
associated with the entity.
@simu simu force-pushed the feat/top-level-getters branch from 5407ea2 to 2e8cff9 Compare February 16, 2024 13:20
Copy link

Benchmark for 12f8127

Click to view benchmark
Test Base PR %
Reclass::inventory() multi-threaded 1635.5±114.46µs 1629.4±85.19µs -0.37%
Reclass::inventory() single-threaded 3.6±0.09ms 3.6±0.09ms 0.00%

@simu simu merged commit a23662f into main Feb 16, 2024
18 checks passed
@simu simu deleted the feat/top-level-getters branch February 16, 2024 13:47
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 this pull request may close these issues.

2 participants