Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The autoconfig does not take into account certain hints. #2

Open
drodarie opened this issue Jul 26, 2023 · 0 comments
Open

The autoconfig does not take into account certain hints. #2

drodarie opened this issue Jul 26, 2023 · 0 comments

Comments

@drodarie
Copy link

May be related to #1.
I want to generate the automatic configuration for the following bsb class:

@config.node
class ShapesComposition:
    shapes = config.list(
        type=GeometricShape,
        required=types.same_size("shapes", "labels", required=True),
        hint=[{"type": "sphere", "radius": 40.0, "center": [0.0, 0.0, 0.0]}],
    )
    labels = config.list(
        type=types.list(),
        required=types.same_size("shapes", "labels", required=True),
        hint=[["soma", "dendrites", "axon"]],
    )
    voxel_size = config.attr(type=float, required=False, default=1.0)

In the sphinx rst file:

.. autoconfig:: bsb.connectivity.point_cloud.ShapesComposition
   :no-imports:
   :max-depth: 2

Results in the following generated python config:

from bsb.connectivity.point_cloud.geometric_shapes import ShapesComposition

ShapesComposition(
  shapes=[
    {
      'epsilon': 0.001,
      'type': 'shape',
    },
  ],
  labels=[
    {
  ],
  voxel_size=1.0,
)

The shapes and labels hint fields are not used for the final config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant