-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from mirkobunse/devel
Fix PyPI: replace the direct extra dependency quapy[composable] with documentation on how to install through git
- Loading branch information
Showing
6 changed files
with
63 additions
and
151 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 |
---|---|---|
|
@@ -28,7 +28,8 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install -e .[bayes,composable,tests] | ||
python -m pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
python -m pip install -e .[bayes,tests] | ||
- name: Test with unittest | ||
run: python -m unittest | ||
|
||
|
@@ -46,7 +47,8 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel "jax[cpu]" | ||
python -m pip install -e .[composable,neural,docs] | ||
python -m pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
python -m pip install -e .[neural,docs] | ||
- name: Build documentation | ||
run: sphinx-build -M html docs/source docs/build | ||
- name: Publish documentation | ||
|
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 |
---|---|---|
|
@@ -447,7 +447,7 @@ The [](quapy.method.composable) module allows the composition of quantification | |
```sh | ||
pip install --upgrade pip setuptools wheel | ||
pip install "jax[cpu]" | ||
pip install quapy[composable] | ||
pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
``` | ||
|
||
### Basics | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,13 @@ | |
This example illustrates the composition of quantification methods from | ||
arbitrary loss functions and feature transformations. It will extend the basic | ||
example on the usage of quapy with this composition. | ||
This example requires the installation of qunfold, the back-end of QuaPy's | ||
composition module: | ||
pip install --upgrade pip setuptools wheel | ||
pip install "jax[cpu]" | ||
pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
""" | ||
|
||
import numpy as np | ||
|
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,45 +1,57 @@ | ||
"""This module allows the composition of quantification methods from loss functions and feature transformations. This functionality is realized through an integration of the qunfold package: https://github.com/mirkobunse/qunfold.""" | ||
|
||
import qunfold | ||
from qunfold.quapy import QuaPyWrapper | ||
from qunfold.sklearn import CVClassifier | ||
from qunfold import ( | ||
LeastSquaresLoss, # losses | ||
BlobelLoss, | ||
EnergyLoss, | ||
HellingerSurrogateLoss, | ||
CombinedLoss, | ||
TikhonovRegularization, | ||
TikhonovRegularized, | ||
ClassTransformer, # transformers | ||
HistogramTransformer, | ||
DistanceTransformer, | ||
KernelTransformer, | ||
EnergyKernelTransformer, | ||
LaplacianKernelTransformer, | ||
GaussianKernelTransformer, | ||
GaussianRFFKernelTransformer, | ||
) | ||
_import_error_message = """qunfold, the back-end of quapy.method.composable, is not properly installed. | ||
__all__ = [ # control public members, e.g., for auto-documentation in sphinx; omit QuaPyWrapper | ||
"ComposableQuantifier", | ||
"CVClassifier", | ||
"LeastSquaresLoss", | ||
"BlobelLoss", | ||
"EnergyLoss", | ||
"HellingerSurrogateLoss", | ||
"CombinedLoss", | ||
"TikhonovRegularization", | ||
"TikhonovRegularized", | ||
"ClassTransformer", | ||
"HistogramTransformer", | ||
"DistanceTransformer", | ||
"KernelTransformer", | ||
"EnergyKernelTransformer", | ||
"LaplacianKernelTransformer", | ||
"GaussianKernelTransformer", | ||
"GaussianRFFKernelTransformer", | ||
] | ||
To fix this error, call: | ||
pip install --upgrade pip setuptools wheel | ||
pip install "jax[cpu]" | ||
pip install "qunfold @ git+https://github.com/mirkobunse/[email protected]" | ||
""" | ||
|
||
try: | ||
import qunfold | ||
from qunfold.quapy import QuaPyWrapper | ||
from qunfold.sklearn import CVClassifier | ||
from qunfold import ( | ||
LeastSquaresLoss, # losses | ||
BlobelLoss, | ||
EnergyLoss, | ||
HellingerSurrogateLoss, | ||
CombinedLoss, | ||
TikhonovRegularization, | ||
TikhonovRegularized, | ||
ClassTransformer, # transformers | ||
HistogramTransformer, | ||
DistanceTransformer, | ||
KernelTransformer, | ||
EnergyKernelTransformer, | ||
LaplacianKernelTransformer, | ||
GaussianKernelTransformer, | ||
GaussianRFFKernelTransformer, | ||
) | ||
|
||
__all__ = [ # control public members, e.g., for auto-documentation in sphinx; omit QuaPyWrapper | ||
"ComposableQuantifier", | ||
"CVClassifier", | ||
"LeastSquaresLoss", | ||
"BlobelLoss", | ||
"EnergyLoss", | ||
"HellingerSurrogateLoss", | ||
"CombinedLoss", | ||
"TikhonovRegularization", | ||
"TikhonovRegularized", | ||
"ClassTransformer", | ||
"HistogramTransformer", | ||
"DistanceTransformer", | ||
"KernelTransformer", | ||
"EnergyKernelTransformer", | ||
"LaplacianKernelTransformer", | ||
"GaussianKernelTransformer", | ||
"GaussianRFFKernelTransformer", | ||
] | ||
except ImportError as e: | ||
raise ImportError(_import_error_message) from e | ||
|
||
def ComposableQuantifier(loss, transformer, **kwargs): | ||
"""A generic quantification / unfolding method that solves a linear system of equations. | ||
|
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 |
---|---|---|
|
@@ -125,7 +125,6 @@ def get_version(rel_path): | |
# projects. | ||
extras_require={ # Optional | ||
'bayes': ['jax', 'jaxlib', 'numpyro'], | ||
'composable': ['qunfold @ git+https://github.com/mirkobunse/[email protected]'], | ||
'neural': ['torch'], | ||
'tests': ['certifi'], | ||
'docs' : ['sphinx-rtd-theme', 'myst-parser'], | ||
|