Make sure that whatever is done by our new `create()` methods is also done by our bindings
We now use create() to create a shared instance of our different classes while, in Python, we use the default constructor. This means that when it comes to the GeneratorProfile class, we end up with a C profile when using C++ while a Python profile when using Python (see issue #508) while we should end up with a C profiler in both cases.
Thinking more about it, I feel like we need to replace the default constructors that we use in our bindings with the create() method. Indeed, some classes (e.g. Variable) has several versions of the create() method. So, we want to make sure that, say, Python users can access all of them in the same way that C++ users can. @nickerso? @hsorby? @kerimoyle?
Oops, just noticed that it looks like @hsorby thought about it (obviously! :p :)), as can be seen here.
So, @kerimoyle, it looks like you need to update your tutorial accordingly.
Ok, it's not clear to me what is actually done in the bindings. So, going to leave it to @hsorby to comment on it once he's back. All I can say is that I can confirm the issue raised by @kerimoyle in issue #508.
I think all we need to do is to add the defaults to all of the construct/create methods:
- the default constructor in C++ (which is available in Python/others)
- the create() constructor in C++ (present already)
- the create() override in Python (since we have one ... ) I think that our C++ base code should be set up well enough not to need manual changes like setting defaults again in the bound language ... way too easy to forget!
See also https://github.com/cellml/libcellml/issues/600
And also issue #603.
This can be closed now ... the create overload is back (not sure when or how though!).