cadCAD-org / cadcad-ri

The Reference Implementation
https://cadcad.org
BSD 2-Clause "Simplified" License
18 stars 10 forks source link

subspace method #34

Open mzargham opened 1 year ago

mzargham commented 1 year ago

proposing we add a method that can be applied to any space that will create a new space from exactly one of its dimensions.

suppose

@space
class CartesianPlane:
    x: float
    y: float

@space
class MySpace:
     pos: CartesianPlane
     vel: CartesianPlane

but then i did

MySubSpace = MySpace.subspace('pos')

the resulting space would be as if i had declared

@space
class MySubSpace:
     pos: CartesianPlane

also open to just returning

CartesianPlane

if we think that is better UX