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

better check for capsule property type #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions add-on-tool/spc_accelerator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,14 @@ def create_mean_formula_string(
output_string = "\n \n//Create average for all grades in one signal using splice(), use keep() to filter the condition by the specific grade code capsule property\n//use within() to show only average only during the condition\n0"
# iterate through each unique property value to add to the average formula
for prop in unique_properties:
if isinstance(prop, str) and prop and prop[0].isalpha():
property_text = re.sub(r"\W+", "", prop)
# case if property is a string (not a number), wrap the match in quotes
# this should really be using capsule property metadata...
if isinstance(prop, str) and prop and not prop.isdigit():
property_text = "prop_" + re.sub(r"\W+", "", prop)
prop_match = "'" + prop + "'"
# case if property is a number, no quotes required
else:
property_text = "a" + re.sub(r"\W+", "", str(prop))
property_text = "prop_" + re.sub(r"\W+", "", str(prop))
prop_match = prop
in_control_string += f"${property_text} = $applytocondition.keep('{capsule_property.v_model}', isMatch({prop_match})).intersect($inputcondition)\n"
unweighted_average_string += f"${property_text}_average = $inputsignal.remove(not ${property_text}).toDiscrete().average($capsule)\n"
Expand Down
2 changes: 1 addition & 1 deletion addon.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function(suffix='')

https://github.com/seeq12/seeq-add-on-spc-accelerator/issues
|||,
version: '1.1.0',
version: '1.1.1',
license: 'Apache 2.0',
icon: 'fa-bullseye',
maintainer: 'Seeq Corporation', // set to Seeq Corporation for AE developed add-ons
Expand Down
4 changes: 4 additions & 0 deletions docs/source/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ Release Notes

* - 1.1.0
- Discrete signals are now supported
-

* - 1.1.1
- Fixed bug where string capsule properties that start with a number caused add-on to hang
-
Loading