Skip to content

Conversation

@tschm
Copy link
Contributor

@tschm tschm commented Nov 12, 2025

Here we test all notebooks (e.g. we run them from top to bottom) with nbmake. nbmake is a package produced by our friend Alex Remedios, see https://github.com/treebeardtech/nbmake. Please note that we had to update the notebooks following a change in yfinance. We have replaced "Adj Close" with "Close".

@tschm
Copy link
Contributor Author

tschm commented Nov 12, 2025

/var/folders/_3/k_9k5d5n5zz57w7qfll9rzs40000gn/T/ipykernel_59786/3860718606.py:1: FutureWarning: YF.download() has changed argument auto_adjust default to True
ohlc = yf.download(tickers, period="max").loc["1990":]
[100%**] 15 of 15 completed

@tschm
Copy link
Contributor Author

tschm commented Nov 12, 2025

@fkiraly This is good to merge

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is going on here?
Your job passed:
https://github.com/PyPortfolio/PyPortfolioOpt/actions/runs/19291419407/job/55162781634

But mine fails with a line from the notebook. So was it not properly tested in your version of the job, or did the yfinance data change?

@fkiraly fkiraly changed the title test for notebooks [MNT] test cookbook notebooks Nov 13, 2025
@fkiraly fkiraly added the maintenance Continuous integration, unit testing & package distribution label Nov 13, 2025
@tschm
Copy link
Contributor Author

tschm commented Nov 14, 2025

API of y finance has been updated many years ago. See the changes in the notebooks. IMHO yfinance should not be used at all. It's just pain. Just download once and commit csv files. Reproducible notebooks

@tschm
Copy link
Contributor Author

tschm commented Nov 14, 2025

@fkiraly oh, you changed the notebooks back? The notebooks need those corrections. Replace "Adj Close" with "Close". It's a pity that jupyter notebooks and git don't work well together. Also, let's not work with a version of yfinance from 2018/2019... It's enough if you revert your last two commits

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 14, 2025

API of y finance has been updated many years ago. See the changes in the notebooks. IMHO yfinance should not be used at all. It's just pain. Just download once and commit csv files. Reproducible notebooks

100% agreed. That is what I would do if I had time to do this 😁

But this does not explain why your version of the notebook tests ran through and my version breaks with the expected API change.

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 14, 2025

@fkiraly oh, you changed the notebooks back? The notebooks need those corrections. Replace "Adj Close" with "Close". It's a pity that jupyter notebooks and git don't work well together. Also, let's not work with a version of yfinance from 2018/2019... It's enough if you revert your last two commits

OOOOOHHHHHHH, yes, that is it. Stupid me - I will revert the notebook reverts.

@fkiraly
Copy link
Collaborator

fkiraly commented Nov 14, 2025

PS: may I kindly ask you to provide a description of the PR contents in your first post? That goes into the squashed commit message. If you are lazy, at least generate an AI description please, that takes 2 seconds.

I know prolific contributors suffer from this syndrome
image
https://xkcd.com/1296/

but let's try?

Copy link
Collaborator

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You were right, I accidentally reverted your fixes to the notebooks.

Could you kindly update the PR description before we merge? So it is not empty?

@tschm
Copy link
Contributor Author

tschm commented Nov 14, 2025

@fkiraly Please merge. I wouldn't have the power to do so...

@fkiraly fkiraly merged commit 1a63132 into PyPortfolio:main Nov 14, 2025
23 checks passed
@tschm tschm deleted the notebooks2 branch November 15, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Continuous integration, unit testing & package distribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants