Skip to content

Commit 1d70991

Browse files
authored
Merge branch 'main' into ci/homogenize-workflows-with-sktime
2 parents 3b920b4 + b63f293 commit 1d70991

33 files changed

Lines changed: 2013 additions & 1379 deletions

.github/dependabot.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
commit-message:
8+
prefix: "[MNT] [Dependabot]"
9+
include: "scope"
10+
labels:
11+
- "maintenance"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "daily"
16+
commit-message:
17+
prefix: "[MNT] [Dependabot]"
18+
include: "scope"
19+
labels:
20+
- "maintenance"

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
needs: check_tag
3636
name: Build wheels
3737
runs-on: ubuntu-latest
38+
needs: [check_tag]
3839

3940
steps:
4041
- uses: actions/checkout@v6
@@ -52,7 +53,7 @@ jobs:
5253
UV_SYSTEM_PYTHON: 1
5354

5455
- name: Store wheels
55-
uses: actions/upload-artifact@v6
56+
uses: actions/upload-artifact@v7
5657
with:
5758
name: wheels
5859
path: wheelhouse/*
@@ -105,7 +106,7 @@ jobs:
105106
id-token: write
106107

107108
steps:
108-
- uses: actions/download-artifact@v7
109+
- uses: actions/download-artifact@v8
109110
with:
110111
name: wheels
111112
path: wheelhouse

docs/FAQ.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FAQs
77
Constraining a score
88
--------------------
99

10-
Suppose that for each asset you have some "score" – it could be an ESG metric, or some custom risk/return metric. It is simple to specify linear constraints, like "portfolio ESG score must be greater than x": you simply create
10+
Suppose that for each asset you have some "score" – it could be an ESG (Environmental, Social, and Governance) metric, or some custom risk/return metric. It is simple to specify linear constraints, like "portfolio ESG score must be greater than x": you simply create
1111
a vector of scores, add a constraint on the dot product of those scores with the portfolio weights, then optimize your objective::
1212

1313
esg_scores = [0.3, 0.1, 0.4, 0.1, 0.5, 0.9, 0.2]

docs/GeneralEfficientFrontier.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ annual return of 20%::
6363
from pypfopt import expected_returns, EfficientSemivariance
6464

6565
df = ... # your dataframe of prices
66-
mu = expected_returns.mean_historical_returns(df)
66+
mu = expected_returns.mean_historical_return(df)
6767
historical_returns = expected_returns.returns_from_prices(df)
6868

6969
es = EfficientSemivariance(mu, historical_returns)
@@ -203,7 +203,7 @@ For example, perhaps our objective is to construct a basket of assets that best
203203
particular index, in other words, to minimise the **tracking error**. This does not fit within
204204
a mean-variance optimization paradigm, but we can still implement it in PyPortfolioOpt::
205205

206-
from pypfopt.base_optimizer import BaseConvexOptimizer
206+
from pypfopt.base import BaseConvexOptimizer
207207
from pypfopt.objective_functions import ex_post_tracking_error
208208

209209
historic_rets = ... # dataframe of historic asset returns
@@ -231,7 +231,7 @@ or a ``nonconvex_objective``, which uses ``scipy.optimize`` as the backend and t
231231
different API. For more examples, check out this `cookbook recipe
232232
<https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/cookbook/3-Advanced-Mean-Variance-Optimization.ipynb>`_.
233233

234-
.. class:: pypfopt.base_optimizer.BaseConvexOptimizer
234+
.. class:: pypfopt.base.BaseConvexOptimizer
235235

236236
.. automethod:: convex_objective
237237

docs/MeanVariance.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ language for convex optimization upon which PyPortfolioOpt's efficient frontier
3232

3333
.. tip::
3434

35-
You can find complete examples in the relevant cookbook `recipe <https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/cookbook/2-Mean-Variance-Optimization.ipynb>`_.
35+
You can find complete examples in the relevant cookbook `recipe <https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/cookbook/2-Mean-Variance-Optimisation.ipynb>`_.
3636

3737

3838
Structure
@@ -114,9 +114,9 @@ Basic Usage
114114
If you would like to use the ``portfolio_performance`` function independently of any
115115
optimizer (e.g for debugging purposes), you can use::
116116

117-
from pypfopt import base_optimizer
117+
from pypfopt.base import portfolio_performance
118118

119-
base_optimizer.portfolio_performance(
119+
portfolio_performance(
120120
weights, expected_returns, cov_matrix, verbose=True, risk_free_rate=0.02
121121
)
122122

@@ -135,7 +135,7 @@ EfficientFrontier inherits from the BaseConvexOptimizer class. In particular, th
135135
add constraints and objectives are documented below:
136136

137137

138-
.. class:: pypfopt.base_optimizer.BaseConvexOptimizer
138+
.. class:: pypfopt.base.BaseConvexOptimizer
139139
:noindex:
140140

141141
.. automethod:: add_constraint

docs/OtherOptimizers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ to code up compared to custom objective functions.
9595

9696
To implement a custom optimizer that is compatible with the rest of PyPortfolioOpt, just
9797
extend ``BaseOptimizer`` (or ``BaseConvexOptimizer`` if you want to use ``cvxpy``),
98-
both of which can be found in ``base_optimizer.py``. This gives you access to utility
98+
both of which can be found in ``pypfopt.base``. This gives you access to utility
9999
methods like ``clean_weights()``, as well as making sure that any output is compatible
100100
with ``portfolio_performance()`` and post-processing methods.
101101

102-
.. automodule:: pypfopt.base_optimizer
102+
.. automodule:: pypfopt.base
103103

104104
.. autoclass:: BaseOptimizer
105105
:members:

docs/Roadmap.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ Roadmap and Changelog
88
Roadmap
99
=======
1010

11-
PyPortfolioOpt is now a "mature" package – it is stable and I don't intend to implement major new functionality (though I will endeavour to fix bugs).
11+
1.6.0
12+
=====
13+
14+
- Support for python 3.14, end-of-life for python 3.8 and 3.9
15+
- Support for pandas 3.0
16+
- Reduction of dependency footprint. Former dependencies are still available as soft dependencies in the new ``all_extras`` depset.
17+
- Feature additions and bugfixes.
1218

1319
1.5.0
1420
=====

docs/UserGuide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ in the sidebar to learn more about the parameters and theoretical details of the
301301
different models offered by PyPortfolioOpt. If you have any questions, please
302302
raise an issue on GitHub and I will try to respond promptly.
303303

304-
If you'd like even more examples, check out the cookbook `recipe <https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/cookbook/2-Mean-Variance-Optimization.ipynb>`_.
304+
If you'd like even more examples, check out the cookbook `recipe <https://github.com/PyPortfolio/PyPortfolioOpt/blob/main/cookbook/2-Mean-Variance-Optimisation.ipynb>`_.
305305

306306

307307
References

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
# built documents.
5757
#
5858
# The short X.Y version.
59-
version = "1.5"
59+
version = "1.6"
6060
# The full version, including alpha/beta/rc tags.
61-
release = "1.5.6"
61+
release = "1.6.0"
6262

6363
# The language for content autogenerated by Sphinx. Refer to documentation
6464
# for a list of supported languages.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<img src="https://img.shields.io/badge/python-v3-brightgreen.svg"
1616
alt="python"></a> &nbsp;
1717
<a href="https://pypi.org/project/PyPortfolioOpt/">
18-
<img src="https://img.shields.io/badge/pypi-v1.5.6-brightgreen.svg"
18+
<img src="https://img.shields.io/badge/pypi-v1.6.0-brightgreen.svg"
1919
alt="python"></a> &nbsp;
2020
<a href="https://opensource.org/licenses/MIT">
2121
<img src="https://img.shields.io/badge/license-MIT-brightgreen.svg"

0 commit comments

Comments
 (0)