-
Notifications
You must be signed in to change notification settings - Fork 0
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
FEAT - 328 - Add support for maximum specification link depth #341
Conversation
Codecov Report
@@ Coverage Diff @@
## main #341 +/- ##
==========================================
- Coverage 95.32% 95.25% -0.08%
==========================================
Files 10 10
Lines 1370 1390 +20
==========================================
+ Hits 1306 1324 +18
- Misses 64 66 +2
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine, just some wording modifications.
def maximum_spec_link_depth(self) -> Optional[int]: | ||
"""Limits the maximum depth of specification to specification links that will be followed when determining | ||
impacted substances or compliance. | ||
If None then no limit will be applied, this may lead to performance issues on databases with large numbers of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If None then no limit will be applied, this may lead to performance issues on databases with large numbers of | |
If None then no limit will be applied, which may lead to performance issues on databases with large numbers of |
|
||
@property | ||
def maximum_spec_link_depth(self) -> Optional[int]: | ||
"""Limits the maximum depth of specification to specification links that will be followed when determining |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The wording here is really hard to get right. To be both precise and concise. How about:
"Limits the maximum number of specification-to-specification links that will be followed when processing a query. If specified, specification-to-specification links will be truncated at the specified depth, and only coatings and substances identified up to and including that point will be included in the analysis.
Defaults to None
, which applies no limit to the number of specification-to-specification links. This may lead to performance issues if there are large numbers of specification-to-specification links present in the database.
Note: this limit applies to each branch of the BoM individually. This is not a global limit on the number of specification-to-specification links that will be traversed across the entire BoM, instead it is a limit on the maximum depth of specifications below any individual specification node."
examples/3_Advanced_Topics/3-3_Database-specific_configuration.py
Outdated
Show resolved
Hide resolved
examples/3_Advanced_Topics/3-3_Database-specific_configuration.py
Outdated
Show resolved
Hide resolved
examples/3_Advanced_Topics/3-3_Database-specific_configuration.py
Outdated
Show resolved
Hide resolved
# This package supports traversing specification to specification links, by default all such links will be followed. | ||
# For typical databases this is the correct and desired behaviour, however in some circumstances this may cause query | ||
# times and response sizes to become very large. In such cases you can control the number of nested links that will be | ||
# followed using the ``maximum_spec_link_depth`` parameter on the ``BomAnalyticsClient`` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# followed using the ``maximum_spec_link_depth`` parameter on the ``BomAnalyticsClient`` object. | |
# using the ``maximum_spec_link_depth`` parameter on the ``BomAnalyticsClient`` object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a Restructured Text xref in here, to link to the actual property documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I realize this is in an example, and so any kind of link to the API documentation will probably be too fragile.
examples/3_Advanced_Topics/3-3_Database-specific_configuration.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Andy Grigg <andrew.grigg@ansys.com>
I realize we also need to add notes, at least on the property docstring, that explain this is only supported in the 2023 R2 RS reports bundle and later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor changes
examples/3_Advanced_Topics/3-3_Database-specific_configuration.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Andy Grigg <andrew.grigg@ansys.com>
This PR adds maximum_specification_link_depth as a property on the BomAnalyticsClient object. Adds a pair of integration tests, and a couple of unit tests, as well as a new example cell in the notebooks.