Skip to content

Commit f6e4e21

Browse files
committed
build images before
1 parent f9588d0 commit f6e4e21

7 files changed

Lines changed: 11 additions & 7 deletions

File tree

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ install-dev: ## Install development dependencies
2424
marimo: ## Run marimo for editing notebooks
2525
@./dev/marimo edit
2626

27+
.PHONY: docs-png
28+
docs-png: ## Regenerate PNG assets in docs/assets/ (requires Chrome via kaleido)
29+
@for f in docs/examples_png/*.py; do uv run python $$f; done
30+
2731
.PHONY: docs
2832
docs: ## build documentation
2933
@cp docs/index.md readme.md
12.1 KB
Loading
12.1 KB
Loading
File renamed without changes.
File renamed without changes.

docs/tutorials/volatility_surface.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ down-weights near-expiry options.
132132
### Plotting the Calibrated Smile
133133

134134
Use [plot()][quantflow.options.calibration.VolModelCalibration.plot] to produce a
135-
Plotly figure overlaying market bid/ask implied vols against the model smile, then
136-
export it to PNG with `write_image`:
135+
Plotly figure overlaying market bid/ask implied vols against the model smile:
137136

138137
```python
139-
--8<-- "docs/examples/vol_surface_heston_plot.py"
138+
fig = calibration.plot(index=1, max_moneyness_ttm=1.5, support=101)
139+
fig.write_image("heston_calibrated_smile.png", width=900, height=500)
140140
```
141141

142142
![Heston calibrated smile](../assets/heston_calibrated_smile.png)
@@ -160,11 +160,11 @@ which captures asymmetric jump behaviour common in equity and crypto markets.
160160
### Plotting the Calibrated Smile
161161

162162
Use [plot()][quantflow.options.calibration.VolModelCalibration.plot] to produce a
163-
Plotly figure overlaying market bid/ask implied vols against the model smile, then
164-
export it to PNG with `write_image`:
163+
Plotly figure overlaying market bid/ask implied vols against the model smile:
165164

166165
```python
167-
--8<-- "docs/examples/vol_surface_hestonj_plot.py"
166+
fig = calibration.plot(index=1, max_moneyness_ttm=1.5, support=101)
167+
fig.write_image("hestonj_calibrated_smile.png", width=900, height=500)
168168
```
169169

170170
![HestonJ calibrated smile](../assets/hestonj_calibrated_smile.png)

quantflow/options/calibration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def plot(
201201
) -> Any:
202202
"""Plot the implied volatility for market and model prices"""
203203
cross = self.vol_surface.maturities[index]
204-
options = tuple(self.vol_surface.option_prices(index=index))
204+
options = tuple(self.vol_surface.option_prices(index=index, converged=True))
205205
cross = self.vol_surface.maturities[index]
206206
model = self.pricer.maturity(cross.ttm(self.ref_date))
207207
if max_moneyness_ttm is not None:

0 commit comments

Comments
 (0)