Socket: Expr #37

Open
opened 2024-05-05 09:15:33 +02:00 by so-rose · 0 comments

The Expr ("Expression") socket allows specifying:

  • Any Shape: There is an intuitive UI for scalar, 2D, and 3D, but the Expr socket also supports parsing mathematical expressions of any shape, and supports passing any large-shaped data too.
  • Math Type: Support integer, rational, real, and complex mathematical types, for which there is an intuitive UI for scalar, 2D, and 3D cases.
  • Physical Type: Supports the declaration of a physical unit dimension, for which a UI exists for the user to switch between long lists of valid units for that dimension, with automatic conversion of the value. This causes the expression to become unit-aware, which will be respected when using it for math.
  • Symbols: Supports the use of variables (each w/predefined MathType) to define arbitrary mathematical expressions, which can be used as part of a function composition chain and/or as a parameter realized at Viz / when generating batched simulations / when performing gradient-based optimization.

TODO

  • Implement node-driven mechanicms for altering symbols dynamically symbols.
  • Implement compatibility with sockets that fundamentally do produce expressions, especially Physical sockets.
  • Implement log scaling support in SocketDef and in the socket for LazyArrayRange.
  • Implement abs min/max support w/support for shaped specificity.
  • Implement soft min/max support w/support for shaped specificity.
  • Implement socket color in response to PhysicalType and MathType.
  • Implement correct shape propagation; can't rely on now-postinit-blocked to make sure ex. Numerical Constant Node actually starts up showing an integer and not a real number.
  • Implement draw_lazy_value_func w/dropdowns for selecting expression inputs to, especially, math nodes.
  • Implement __hash__-like method for performantly comparing an Expr socket to its SocketDef.
    • This would find a lot of use in any methods that create loose Expr sockets.
  • Implement a proper capabilities() to enforce compatibility between correctly specified Expr sockets.
  • Pass ruff lint.
  • Implement precision support for floats.
  • Implement hard-coded steps for LazyArrayRange, for cases where it is a range but the steps should not be editable via UI (ex. start/stop w/steps=2).
  • See #4.
  • Implement semi- rejection (via capabilities) of inputs that might not respect abs_min/abs_max.

Expr Constant Node

Should expose most/all of the Expr socket features, but most importantly, the symbolic ones.

  • Implement
The `Expr` ("Expression") socket allows specifying: - **Any Shape**: There is an intuitive UI for scalar, 2D, and 3D, but the `Expr` socket also supports parsing mathematical expressions of any shape, and supports passing any large-shaped data too. - **Math Type**: Support integer, rational, real, and complex mathematical types, for which there is an intuitive UI for scalar, 2D, and 3D cases. - **Physical Type**: Supports the declaration of a physical unit dimension, for which a UI exists for the user to switch between long lists of valid units for that dimension, with automatic conversion of the value. This causes the expression to become unit-aware, which will be respected when using it for math. - **Symbols**: Supports the use of variables (each w/predefined `MathType`) to define arbitrary mathematical expressions, which can be used as part of a function composition chain and/or as a parameter realized at `Viz` / when generating batched simulations / when performing gradient-based optimization. ## TODO - [ ] Implement node-driven mechanicms for altering symbols dynamically symbols. - [x] Implement compatibility with sockets that fundamentally do produce expressions, especially Physical sockets. - [x] Implement log scaling support in `SocketDef` and in the socket for `LazyArrayRange`. - [ ] Implement abs min/max support w/support for shaped specificity. - [ ] Implement soft min/max support w/support for shaped specificity. - [ ] Implement socket color in response to PhysicalType and MathType. - [x] Implement correct `shape` propagation; can't rely on now-postinit-blocked to make sure ex. `Numerical Constant Node` actually starts up showing an integer and not a real number. - [x] Implement `draw_lazy_value_func` w/dropdowns for selecting expression inputs to, especially, math nodes. - [ ] Implement `__hash__`-like method for performantly comparing an `Expr` socket to its `SocketDef`. - This would find a lot of use in any methods that create loose `Expr` sockets. - [ ] Implement a proper `capabilities()` to enforce compatibility between correctly specified `Expr` sockets. - [ ] Pass `ruff` lint. - [ ] Implement precision support for floats. - [ ] Implement hard-coded `steps` for `LazyArrayRange`, for cases where it is a range but the steps should not be editable via UI (ex. start/stop w/`steps=2`). - See #4. - [ ] Implement semi- rejection (via `capabilities`) of inputs that might not respect `abs_min`/`abs_max`. ## `Expr Constant` Node Should expose most/all of the Expr socket features, but most importantly, the symbolic ones. - [x] Implement
so-rose added the
enhancement
physical
architecture
abstractions
feature
labels 2024-05-05 09:15:33 +02:00
so-rose added a new dependency 2024-05-05 09:58:04 +02:00
so-rose removed the
architecture
feature
labels 2024-05-05 18:14:18 +02:00
so-rose added this to the Robust Simulation milestone 2024-05-07 10:04:53 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Blocks
Reference: so-rose/oscillode#37
There is no content yet.