bessagroup / f3dasm

Framework for Data-Driven Design & Analysis of Structures & Materials (F3DASM)
https://f3dasm.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
115 stars 30 forks source link

Advanced discrete parameter (from a list, with a step != 1, etc.) #131

Closed GuillaumeBroggi closed 12 months ago

GuillaumeBroggi commented 1 year ago

Motivation

It can be useful to specify discrete numerical parameters that do not include every values from the lower to upper bound.

Categorical parameters provide a similar functionality, but for strings, and from a design point of view, a discrete parameter restricted to some values is not a categorical parameter.

Description

The feature could be implemented by implementing a new discrete parameter class (or updating the existing one) that can be constructed with a list, like the categorical parameters.

An additional argument step could also be implemented for the exiting class.

Alternatives (optional)

No response

Additional context (optional)

No response

mpvanderschelling commented 12 months ago

The Domain.add_category method accepts an Iterable of values. These values can be arbitrary, so the functionality that you describe has been implemented!

A step method has been implemented as an optional argument of the Domain.add_int method. The default stepsize is 1