Shimul-Baidya / MBDyn

GNU General Public License v2.0
1 stars 1 forks source link

Improve typing of Drive Caller dependents #7

Open Maarrk opened 4 days ago

Maarrk commented 4 days ago

I noticed that the ConstitutiveLaw class has this configuration: https://github.com/Shimul-Baidya/MBDyn/blob/80f359c36febf36195c5d767f7db161aa880a14e/contrib/PythonPreprocessor/MBDynLib.py#L3795-L3796

Is it because we need to use drive caller in LinearElasticBistop, LinearTimeVariantViscoelasticGeneric and some other places and DriveCaller isn't a subclass of MBEntity yet? If that's the case I'd prefer for this relaxed config to be defined only in classes that need it. I know it feels lime duplication, but this way we show that the class has incomplete validation.

Also, until we rework all drive callers, I think we should describe the type as Union[DriveCaller, DriveCaller2] to allow using the new definitions where available.