optimagic-dev / optimagic

optimagic is a Python package for numerical optimization. It is a unified interface to optimizers from SciPy, NlOpt and other packages. optimagic's minimize function works just like SciPy's, so you don't have to adjust your code. You simply get more optimizers for free. On top you get diagnostic tools, parallel numerical derivatives and more.
https://optimagic.readthedocs.io/
MIT License
266 stars 30 forks source link

Dark mode logo #479

Closed segsell closed 5 months ago

segsell commented 8 months ago

Add dark mode logo to the navigation bar and on the main index page.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.00%. Comparing base (5574283) to head (8535245).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #479 +/- ## ========================================== + Coverage 92.98% 93.00% +0.01% ========================================== Files 194 194 Lines 14659 14659 ========================================== + Hits 13631 13633 +2 + Misses 1028 1026 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

review-notebook-app[bot] commented 6 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

janosg commented 5 months ago

The link to the logo in the navigation bar is not being found. Using the pandas dark mode logo and our standard estimagic logo as dummies worked. Maybe, once we merge this PR into main, the location of our dark mode logo will be available, too. Note that the logo settings for the navigation bar are specified in conf.py. Maybe this makes it different to the main index page, which is set up in index.md. There, the same image reference is actually found.

Is this still the case? I did not see any problems.

segsell commented 5 months ago

The link to the logo in the navigation bar is not being found. Using the pandas dark mode logo and our standard estimagic logo as dummies worked. Maybe, once we merge this PR into main, the location of our dark mode logo will be available, too. Note that the logo settings for the navigation bar are specified in conf.py. Maybe this makes it different to the main index page, which is set up in index.md. There, the same image reference is actually found.

Is this still the case? I did not see any problems.

That's outdated and has been fixed. Thanks!

segsell commented 5 months ago
* When dark-mode is active, the plots in notebooks are still shown in a light theme. QuantEcon has found a way to switch to a dark theme. Click on the change contrast symbol [here](https://python-programming.quantecon.org/matplotlib.html) to try it out. Do you think it would be super hard to add this?

Unfortunately, that's not straightforward. It seems like QuantEcon have developed their own docs template. I haven't seen any sphinx theme like furo or pydata that have this feature. A second difference is that they use a .md file instead of a .ipynb jupyter notebook.

In a static fashion, changing the matplotlib theme in a jupyter notebook is straightforward:

import matplotlib.pyplot as plt  
plt.style.use('dark_background')

However, automatically switching between the light and dark theme is tricky. Locally, the workaround is modifying some .ipython file. At the moment, I don't have an idea how this can be achieved for the sphinx documentation.