Skip to content

Conversation

@HumphreyYang
Copy link
Member

@HumphreyYang HumphreyYang commented Aug 17, 2025

This PR fixes the os.fork warning documented in #548.

This together with #556, fixes #548.

@github-actions
Copy link

github-actions bot commented Aug 17, 2025

@HumphreyYang HumphreyYang added bug Something isn't working do-not-merge labels Aug 17, 2025
@HumphreyYang HumphreyYang marked this pull request as draft August 17, 2025 13:40
@HumphreyYang
Copy link
Member Author

Hi @mmcky,

I tried different approaches but no method gives clean output like ! does.

I find that we can fix the warning by importing jax after we run ! so the os.fork() does not collide with imported jax

This PR fixes the two warnings on my end.

The error now is caused by a strange error from back_prop.

@HumphreyYang HumphreyYang changed the title [FIX] Fix jax fork warning on status page [FIX] Fix jax and os.fork warnings Aug 18, 2025
@HumphreyYang HumphreyYang changed the title [FIX] Fix jax and os.fork warnings [FIX] Fix jax and os.fork warnings Aug 18, 2025
```{code-cell} ipython3
fig = go.Figure()
fig.add_trace(go.Scatter(x=grid, y=f_val, name=r'$-3x+2$'))
Copy link
Contributor

Choose a reason for hiding this comment

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

@HumphreyYang the failure in back_prop in the pdf builder could be due to the removal of these $ signs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I will run locally to check and confirm.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @mmcky,

I removed them because of the error but it doesn't seem to be working : (

Copy link
Contributor

Choose a reason for hiding this comment

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

@HumphreyYang I think the error was due to big changes in plotly and Kaleido versions. It also seems to have been re-written around chrome.

@mmcky
Copy link
Contributor

mmcky commented Aug 18, 2025

@HumphreyYang I can build this branch locally -- I have triggered another run just in case. Leave this with me. Thanks of your work on this.

@mmcky
Copy link
Contributor

mmcky commented Aug 18, 2025

@HumphreyYang the issue being reported in back_prop was

�[0;31mValueError�[0m: 
Image export using the "kaleido" engine requires the kaleido package,
which can be installed using pip:
    $ pip install -U kaleido

so trying an install upgrade.

@HumphreyYang
Copy link
Member Author

HumphreyYang commented Aug 18, 2025

Hi @mmcky,

I think this might be related to QuantEcon/lecture-python-advanced.myst#221.

Something breaks when using Image with kaleido

@github-actions github-actions bot temporarily deployed to pull request August 21, 2025 04:55 Inactive
@HumphreyYang
Copy link
Member Author

Many thanks @mmcky! It looks like it is building!!

I think colab servers do not have chrome so it might be hard to solve on the colab side.

@github-actions github-actions bot temporarily deployed to pull request August 21, 2025 05:56 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 01:08 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 02:16 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 02:17 Inactive
@mmcky mmcky marked this pull request as ready for review August 22, 2025 02:28
@mmcky mmcky requested a review from Copilot August 22, 2025 02:28

This comment was marked as outdated.

@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 02:55 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 02:55 Inactive
@mmcky mmcky added ready and removed bug Something isn't working do-not-merge labels Aug 22, 2025
@mmcky mmcky requested a review from Copilot August 22, 2025 04:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses JAX and os.fork warnings reported in issue #548 by reorganizing import statements and improving build configuration. The changes ensure proper JAX initialization order and suppress unnecessary warning messages during the build process.

  • Reorganizes JAX imports and GPU checks in lecture files to prevent initialization warnings
  • Updates package installation commands for better compatibility
  • Adds warning suppression configuration to prevent build noise

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
lectures/status.md Reorders GPU check to occur before JAX backend verification
lectures/back_prop.md Moves JAX installation and import after other package setups, updates plotly installation
lectures/_config.yml Adds warning suppression for unknown MIME types
.github/workflows/ci.yml Updates artifact naming and removes failure condition

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 04:56 Inactive
@github-actions github-actions bot temporarily deployed to pull request August 22, 2025 04:57 Inactive
@mmcky
Copy link
Contributor

mmcky commented Aug 22, 2025

thanks @HumphreyYang great to get those warnings removed. LGTM

@mmcky mmcky merged commit 307c7f1 into main Aug 22, 2025
7 checks passed
@mmcky mmcky deleted the fix-i548-2 branch August 22, 2025 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python warnings found in code output

3 participants