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
Classes in DataObjects/MDEVents layers need exposing to Python #10649
Comments
@NickDraper (2014-12-08T10:25:34): @martyngigg (2015-05-01T15:10:06): @martyngigg (2015-05-02T22:12:11): This will allow boost.python to take care of automatically downcasting @martyngigg (2015-05-25T20:45:25): The tests still don't work yet. @martyngigg (2015-06-01T10:57:59): This will allow boost.python to take care of automatically downcasting @martyngigg (2015-06-01T10:57:59): The tests still don't work yet. @martyngigg (2015-06-01T10:57:59): This should now happen behind the scenes in Boost Python. @martyngigg (2015-06-01T10:57:59): Improve WorkspaceGroup test to cover the use case. |
Conflicts: Code/Mantid/Framework/PythonInterface/mantid/api/src/Algorithms/RunPythonScript.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/AnalysisDataService.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/BinaryOperations.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IEventWorkspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IMDEventWorkspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IMDHistoWorkspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/IPeaksWorkspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/ITableWorkspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MDGeometry.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/Workspace.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceFactory.cpp Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceGroup.cpp Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Exports/PropertyWithValue.cpp Code/Mantid/Framework/PythonInterface/mantid/kernel/src/Registry/DowncastRegistry.cpp Refs #10649
By default boost will try to construct a new pointer type when extracting a C++ type from a Python object. We need to ensure we get back the same pointer object so we use a reference type in ExtractWorkspace. This then requires that all return types that convert to a Python object return a common Workspace_sptr or the reference extraction fails. Refs #10649
Clang and MSVC won't compile with the additional dependencies. Gcc does though... Refs #10649
Changes are mainly due to the end types in Python being slightly different. Refs #10649
This issue was originally TRAC 9807
This ticket is blocked by :
This ticket is blocks : TRAC8943
When trying to implement http://trac.mantidproject.org/mantid/ticket/8943 it was found that the current mechanism for trying to get boost python to return the correct type for the actual workspace type was flawed, as it can never handle multiple inheritance.
The only way to get the correct type back in Python is to expose all of the concrete Workspace types and just let boost.python do the heavy lifting. This will currently require classes from DataObjects & MDEvents to be exported
The only question is whether to have a single compiled Python
_plugins
module that exports all from each of the C++ libraries or one Python module for each plugin.Keywords: Maintenance
The text was updated successfully, but these errors were encountered: