-
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.
* Added RailDataset, to allow for strong checking of type-matching between plotters and the datasets they use * isort * fixing up docs * use classes own name in generate_dataset_dict()
- Loading branch information
Showing
49 changed files
with
545 additions
and
673 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
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
============================= | ||
Adding a new RailDataset type | ||
============================= | ||
|
||
Because of the variety of formats of files in RAIL, and the variety of analysis flavors | ||
in a ``RailProject``, it is useful to be able to define the particular types of | ||
datasets that are needed to make specific plots. These are implemented as subclasses of the :py:class:`rail.plotting.dataset.RailDataset` class. | ||
A ``RailDataset`` is intended define the quantities needed to make a particular type of plot. | ||
|
||
|
||
New RailDataset Example | ||
----------------------- | ||
|
||
The following example has all of the required pieces of a ``RailDataset`` and almost nothing else. | ||
|
||
.. code-block:: python | ||
class RailPZPointEstimateDataset(RailDataset): | ||
"""Dataet to hold a vector p(z) point estimates and corresponding | ||
true redshifts | ||
""" | ||
data_types = dict( | ||
truth=np.ndarray, | ||
pointEstimate=np.ndarray, | ||
) | ||
The required pieces, in the order that they appear are: | ||
|
||
#. The ``RailPZPointEstimateDataset (RailDataset):`` defines a class called ``RailPZPointEstimateDataset`` and specifies that it inherits from ``RailDataset``. | ||
|
||
#. The ``data_types`` define names and expected data types of the required data. |
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.