forked from odlgroup/odl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Makes odlpp a plugin * Changes all tight cuplings to odlpp to be loose cuplings, thus forcing interface changes in many places. * `FnBase` and `NtuplesBase` type spaces can now be added to ODL by external packages through the `odl.space` hook. This allows users to add new implementations to the odl spaces. * Changed `Rn` etc syntax to be `rn`, added `impl` parameter. Now any `rn` type space can be created using `odl.rn(3, impl)` * In line with the above, all numpy spaces are now named `NumpyFn` etc.
- Loading branch information
Showing
52 changed files
with
1,298 additions
and
4,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "odlpp"] | ||
path = odlpp | ||
url = https://github.com/odlgroup/odlpp.git | ||
[submodule "doc/sphinxext"] | ||
path = doc/sphinxext | ||
url = https://github.com/odlgroup/numpydoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
############# | ||
Extending ODL | ||
############# | ||
|
||
ODL is written to be easy to extend with new functionality and classes, and new content is welcome. With that said, not everything fits inside the main library and some ideas are better done as *extension packages*. This may give your package more freedom and allows a faster development cycle and help keep ODL from overflowing with content. | ||
|
||
There are several ways to extend ODL, some will be listed below. | ||
|
||
Adding Fn spaces | ||
---------------- | ||
The abstract spaces `FnBase` and `NtuplesBase` are the workhorses of the ODL space machinery. They are used in both the discrete :math:`R^n` case, as well as data representation for discretized function spaces such as :math:`L^2([0, 1])` in the `DiscretizedSpace` class. These are in general created through the `rn` and `uniform_discr` functions who take an ``impl`` parameter, allowing users to select the backend to use. | ||
|
||
In the core ODL package, there is only a single backend available: `NumpyFn`/`NumpyNtuples`, given by ``impl='numpy'``, which is the default choice. Users can add CUDA support by installing the add-on library odlcuda_, which contains the additional spaces ``CudaFn``/``CudaNtuples``. By using the `rn`/`uniform_discr` functions, users can then seamlessly change the backend of their spaces. | ||
|
||
As an advanced user, you may need to add additional spaces of this type that can be used inside ODL, perhaps to add MPI_ support. There are a few steps to do this: | ||
|
||
* Create a new library with a ``setuptools`` installer. | ||
* Add the spaces that you want to add to the library. The space needs to inherit from `NtuplesBase` or `FnBase`, respectively, and implement all of the abstract methods in those spaces. See the spaces for further information on the specific methods that need to be implemented. | ||
* Add the methods ``ntuples_impls()`` and ``fn_impls()`` to a file ``odl_plugin.py`` in your library. These should return a ``dict`` mapping names to implementations. | ||
* Add the following to your library's ``setup.py`` setup call: ``entry_points={'odl.space': ['odl_cuda = odlcuda.odl_plugin']``, where you replace ``odlcuda`` with the name of your plugin. | ||
|
||
.. _odlcuda: https://github.com/odlgroup/odlcuda | ||
.. _MPI: https://en.wikipedia.org/wiki/Message_Passing_Interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.