Metadata-Version: 2.4
Name: qp_flexzboost
Version: 1.0
Author-email: LINCC Frameworks <lincc-frameworks-team@lists.lsst.org>, Drew Oldag <awoldag@uw.edu>
License: MIT License
        
        Copyright (c) 2023 LSST Dark Energy Science Collaboration (DESC)
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Astronomy
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: flexcode
Requires-Dist: numpy>=1.24
Requires-Dist: qp-prob>=1.0.0
Requires-Dist: scipy>=1.9.0
Provides-Extra: dev
Requires-Dist: ipykernel; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: qp-prob[full]>=1.0.0; extra == "dev"
Requires-Dist: sphinx==6.1.3; extra == "dev"
Requires-Dist: sphinx-rtd-theme==1.2.0; extra == "dev"
Requires-Dist: sphinx-autoapi==2.0.1; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: nbconvert; extra == "dev"
Requires-Dist: nbsphinx; extra == "dev"
Requires-Dist: ipython; extra == "dev"
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Requires-Dist: jupytext; extra == "dev"
Dynamic: license-file

![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/lsstdesc/qp_flexzboost/testing-and-coverage.yml?branch=main)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/lsstdesc/qp_flexzboost/smoke-test.yml?label=smoke%20test)
![Codecov](https://img.shields.io/codecov/c/github/lsstdesc/qp_flexzboost)
[![Read the Docs](https://img.shields.io/readthedocs/qp-flexzboost)](https://qp-flexzboost.readthedocs.io/en/latest/index.html)

[![Template](https://img.shields.io/badge/Template-LINCC%20Frameworks%20Python%20Project%20Template-brightgreen)](https://lincc-ppt.readthedocs.io/en/latest/)

# qp_flexzboost

This package allows for efficient, lossless storage of [Flexcode](https://github.com/lee-group-cmu/FlexCode)[^1][^2] conditional density estimates and leverages the machinery provided by [qp](https://github.com/LSSTDESC/qp). 

The primary module in the package provides the `FlexzboostGen` class, a subclass of the `qp.Pdf_rows_gen` class. 

An API to retrieve PDF, CDF, and PPF values in addition to supporting simple plotting of PDFs is provided. 

While it is possible to use all of the standard `scipy.rvs_continuous` methods to work with a `qp.Ensemble` of CDEs stored as `FlexzboostGen` objects, it is much more efficient to convert the `FlexzboostGen` representation into a native `qp` representation, such as `qp.interp`. 

`FlexzboostGen` is not included as a part of `qp` by default for the following reasons: 
1) It is not possible to convert from a native `qp` representation into a `FlexzboostGen` representation because `FlexzboostGen` stores the output of machine learned model. However, it **is** possible to convert from `FlexzboostGen` to any other native `qp` representation.
2) The use case is very tightly coupled to `Flexcode` and currently supports one specific use case - efficient storage of `qp.Ensemble` objects produced as output from [rail_flexzboost](https://github.com/LSSTDESC/rail_flexzboost) stages.

For more information and usage examples, please see the documentation and API reference available here: https://qp-flexzboost.readthedocs.io/en/latest/index.html


## Attribution

This project was automatically generated using the LINCC Frameworks [Python Project Template](https://github.com/lincc-frameworks/python-project-template).

For more information about the project template see the [documentation](https://lincc-ppt.readthedocs.io/en/latest/).



[^1]: Rafael Izbicki and Ann B. Lee, “Converting high-dimensional regression to high-dimensional conditional density estimation”, Electron. J. Statist. 11(2): 2800-2831 (2017). DOI: 10.1214/17-EJS1302

[^2]: Schmidt et al, “Evaluation of probabilistic photometric redshift estimation approaches for The Rubin Observatory Legacy Survey of Space and Time (LSST)“, MNRAS, 449(2): 1587-1606. https://doi.org/10.1093/mnras/staa2799
