Skip to content

Lazy evaluations of get, and vget calls #4190

@germa89

Description

@germa89

Some methods returns arrays by default which is convenient but it might be expensive if those arrays are not used.

For instance, vget:

    @wraps(MapdlBase.vget)
    def vget(
        self,
        par: str = "",
        ir: MapdlInt = "",
        tstrt: MapdlFloat = "",
        kcplx: MapdlInt = "",
        **kwargs: KwargDict,
    ) -> NDArray[np.float64]:
        """Wraps VGET"""
        super().vget(par=par, ir=ir, tstrt=tstrt, kcplx=kcplx, **kwargs)
        if not self._store_commands:
            return self.parameters[par]

Ideally we would like to execute the server side call, and then return sort of a "promise" or a lazy evaluated numpy array. The actual values wont be retrieved until the output object is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions