Skip to content

Commit

Permalink
Merge pull request #37 from gramaziokohler/36-rename-component-prefixes
Browse files Browse the repository at this point in the history
# prefixes renamed
  • Loading branch information
funkchaser authored May 6, 2024
2 parents 5ce9b6b + 8377593 commit 33d3164
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ with Grasshopper's **Param** components:

Rename these components:

- for inputs, use the names of the design parameters prefixed with ``GENERATED_``
- for outputs, use the names of the performance attributes prefixed with ``REAL_``
- for inputs, use the names of the design parameters prefixed with ``DP_`` (accronym for *Design Parameters*)
- for outputs, use the names of the performance attributes prefixed with ``PA_`` (accronym for *Performance Attributes*).


.. hint::
Expand Down
2 changes: 1 addition & 1 deletion src/aixd_ara/gh_ui_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def instantiate_sample(ghdoc, sample_dict):
"""

for dp_name, dp_vals in sample_dict["design_parameters"].items():
component_name = "GENERATED_{}".format(dp_name)
component_name = "DP_{}".format(dp_name)
component = find_component_by_nickname(ghdoc, component_name)

if not dp_vals:
Expand Down
4 changes: 2 additions & 2 deletions src/aixd_ara/scripts/dataset_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def analysis_callback(ghdoc, dp_samples, pa_names):
# pass design parameters (sample by sample) to Grasshopper model and read the performance attributes
for sample in dp_samples:
for dp_name, dp_vals in sample.items():
component_name = "GENERATED_{}".format(dp_name)
component_name = "DP_{}".format(dp_name)
component = find_component_by_nickname(ghdoc, component_name)
ghparam_set_values(component, dp_vals, expire=False)

pa_dict = {k: [] for k in pa_names}
for pa_name in pa_names:

component_name = "REAL_{}".format(pa_name)
component_name = "PA_{}".format(pa_name)
component = find_component_by_nickname(ghdoc, component_name)
pa_vals = ghparam_get_values(component, compute=True)
if isinstance(pa_vals, list):
Expand Down

0 comments on commit 33d3164

Please sign in to comment.