Skip to content

Improved and added to loops over tables#34

Merged
paulsaxe merged 1 commit intomainfrom
dev
May 15, 2025
Merged

Improved and added to loops over tables#34
paulsaxe merged 1 commit intomainfrom
dev

Conversation

@paulsaxe
Copy link
Contributor

  • Added a 'between' operator to filter rows of tables.
  • Ensured the correct types of variables in the rows of a table, fixing an issues that caused e.g. integers to be treated as floats.
  • Added an option, on by default, to make variables with the name of the columns in the tables, holding the values.
  • Using directory names that are the index of the row in the table.

* Added a 'between' operator to filter rows of tables.
* Ensured the correct types of variables in the rows of a table, fixing an issues
  that caused e.g. integers to be treated as floats.
* Added an option, on by default, to make variables with the name of the columns in
  the tables, holding the values.
* Using directory names that are the index of the row in the table.
@paulsaxe paulsaxe requested review from Copilot and seamm May 15, 2025 18:38
@paulsaxe paulsaxe added the enhancement New feature or request label May 15, 2025
Copy link
Contributor

@seamm seamm left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances table-based loops by adding a new range operator, improving type handling, exposing row values as variables, and customizing iteration directory names.

  • Introduces a "between" operator for row filtering
  • Converts query values to the column’s native type
  • Adds an "as variables" option to create individual variables per column
  • Uses the row index to name iteration directories

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
loop_step/tk_loop.py Updated dialog layout to include "as variables" and support a second input for "between"
loop_step/loop_parameters.py Added "between" operator and parameters for query-value2 and as variables option
loop_step/loop.py Implemented range filtering, type conversion, variable injection, and directory naming by index
HISTORY.rst Documented the new features in the release history
Comments suppressed due to low confidence (1)

HISTORY.rst:6

  • Grammar: change "fixing an issues" to "fixing an issue" or "fixing issues".
*   Ensured the correct types of variables in the rows of a table, fixing an issues

Comment on lines +142 to +148
"default": "yes",
"kind": "boolean",
"default_units": "",
"enumeration": ("yes", "no"),
"format_string": "",
"description": "Values as variables:",
"help_text": "Whether to put the values for the row as seperate variables.",
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

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

The parameter "as variables" is declared with kind "boolean" but uses string values "yes"/"no" in its enumeration. Either change kind to "enumeration" or use actual boolean values (true/false) to match the declared kind.

Suggested change
"default": "yes",
"kind": "boolean",
"default_units": "",
"enumeration": ("yes", "no"),
"format_string": "",
"description": "Values as variables:",
"help_text": "Whether to put the values for the row as seperate variables.",
"default": True,
"kind": "boolean",
"default_units": "",
"enumeration": (True, False),
"format_string": "",
"description": "Values as variables:",
"help_text": "Whether to put the values for the row as separate variables.",

Copilot uses AI. Check for mistakes.
@paulsaxe paulsaxe merged commit b3b3539 into main May 15, 2025
8 checks passed
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