-
Notifications
You must be signed in to change notification settings - Fork 2
Splitting __wrapper__.py in __wrapper__ module
#31
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
Conversation
|
Not sure about why the tests are failing on the server, they all pass locally... |
|
It seems because in from .runtime import Runtime
from .matlab_class import MatlabClass
from .matlab_function import MatlabFunction
from .cell import Cell
from .struct import Struct
from .array import Array
from .sparse_array import SparseArrayThat said, I do prefer It all looks great otherwise! |
|
For circular imports, we could also monkey patch from .runtime import Runtime
from .matlab_class import MatlabClass
from .matlab_function import MatlabFunction
from .cell import Cell
from .struct import Struct
from .array import Array
from .sparse_array import SparseArray
from .core import MatlabType
from .factory import MatlabTypeFactory
MatlabType.from_any = MatlabTypeFactory.from_anyThat's only if we want to eventually expose all core types in a potential |
|
Thank you for your comment, it put me on the way. It turns out that it was working on my side because the files had been renamed to snake_case, but apparently Git does not consider case change as a change, so the new name did not propagate, giving this issue. Using |
|
Merging as PR approved and tests passing. |
This follows from discussions (#22) about debloating the wrapper.py file.
Main changes
The file is now split it several files:
spm.__wrapper__.corecontains most of the new type system's mechanicsspm.__wrapper__.utilscontains private helper functionsspm.__wrapper__.helperscontains what was previously inspm.cheatsspm/__wrapper__/Cell.pymatlabvariable is removed, thematlabmodule can be obtained bymatlab = _import_matlab()(@balbasty assuming this temporary import mechanism is still necessary)Limitations
FIXMEwhen possible. Ultimately, classes incoreshould not depend on external classes. Moreover, the type hierarchy should be respected. One of the reason for circular imports is that we use the mainMatlabTypeas a factory (when usingfrom_any). We could have an externalMatlabTypeFactoryhandling the role of instantiating new objects.