Skip to content

ReinforcementLayout: output shows <empty> on error instead of an empty tree #33

Closed

Description

@fstwn

What happens

When DDU_CSC_ReinforcementLayout stops early or fails, its Evidence output shows <empty> instead of carrying no data. In grasshopper_userobjects_src/DDU_CSC_ReinforcementLayout.py:

  • RunScript starts with Evidence = '' and returns it from every error path, so an empty string goes out as one item.
  • empty_outputs() (used when the library is missing or the outputs were just updated) returns None for a single output.

Downstream components such as AddEvidence then receive an item that is not a record.

Expected

By the convention of the CSC Grasshopper components, an output without a result is an empty Grasshopper tree: no branch items, neither an empty string nor null. The Add components already do this, e.g. DDU_CSC_AddEvidence.py initialises Stored = Grasshopper.DataTree[System.Object]() and returns it on every early exit.

  • Initialise Evidence as Grasshopper.DataTree[System.Object]() and return it on every path without a record (missing input, error, _stop()).
  • On success, put the record JSON into that tree (or return the string, if a single item is what the convention expects for a successful run; keep it the same as the other Create / build components).
  • empty_outputs() returns an empty tree for each output, so the early stop also gives no data.

Done when

  • Every error path and the early stop leave the Evidence output with no data (no <empty>, no <null>).
  • A successful run gives the record JSON as before.
  • A test in tests/grasshopper checks that the error and early-stop paths return an empty tree.
  • Check whether other build components (ApplyFrame, the Create components) return '' or None the same way, and name them in the PR.
  • The re-exported user object (.ghuser and its XML) follows with the next Grasshopper release.

Related: the issue on missing inputs as warnings (#32); both touch the same RunScript.

Activity

  1. fstwn commented on Nov 4, 2026

    @fstwn
    ContributorAuthor

    Fixed in 0.6.4.4 (#53).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggrasshopper-interfaceIssues regarding the GH interface

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions