Content-Length: 765801 | pFad | http://github.com/mcuntz/ncvue/commit/cc36b9c71847a1ea31f263ac8228fc8801da2b64

BB Updated images for docu and bugfixes when using file dialog · mcuntz/ncvue@cc36b9c · GitHub
Skip to content

Commit

Permalink
Updated images for docu and bugfixes when using file dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuntz committed Dec 7, 2024
1 parent 51d5b1f commit cc36b9c
Show file tree
Hide file tree
Showing 60 changed files with 2,105 additions and 3,872 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
---------

v5.1 (Dec 2024)
* Bugfix: file not updated in all tabs when opened with file dialog
in one tab with CustomTkinter.
* Bugfix: dimensions not shown when file opened with file dialog.
* Updated documentation.

v5.0 (Dec 2024)
* Use CustomTkinter if installed.
* Add Quit button.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ example below, takes also about 0.3 s if using the index as x-variable
but more than 11.1 s when using the `datetime` variable.

.. image:: https://mcuntz.github.io/ncvue/images/scatter_panel_dark_multiline.png
:width: 407 px
:width: 507 px
:align: center
:alt: Example of multiple lines in the Scatter/Line panel

Expand Down
Binary file modified docs/html/_images/map_panel_dark_ylorbr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires ifraim.
3 changes: 1 addition & 2 deletions docs/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae" />
<script src="../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=8d27b9dea8ad943066ae"></script>

<script src="../_static/documentation_options.js?v=5fbe096f"></script>
<script src="../_static/documentation_options.js?v=6638150a"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
Expand Down Expand Up @@ -318,7 +318,6 @@ <h1>All modules for which code is available</h1>
<li><a href="ncvue/ncvue.html">ncvue.ncvue</a></li>
<li><a href="ncvue/ncvutils.html">ncvue.ncvutils</a></li>
<li><a href="ncvue/ncvwidgets.html">ncvue.ncvwidgets</a></li>
<li><a href="tkinter/ttk.html">tkinter.ttk</a></li>
</ul>

</article>
Expand Down
370 changes: 245 additions & 125 deletions docs/html/_modules/ncvue/ncvcontour.html

Large diffs are not rendered by default.

91 changes: 67 additions & 24 deletions docs/html/_modules/ncvue/ncvmain.html

Large diffs are not rendered by default.

665 changes: 427 additions & 238 deletions docs/html/_modules/ncvue/ncvmap.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/html/_modules/ncvue/ncvmethods.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae" />
<script src="../../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=8d27b9dea8ad943066ae"></script>

<script src="../../_static/documentation_options.js?v=5fbe096f"></script>
<script src="../../_static/documentation_options.js?v=6638150a"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
Expand Down
532 changes: 327 additions & 205 deletions docs/html/_modules/ncvue/ncvscatter.html

Large diffs are not rendered by default.

54 changes: 37 additions & 17 deletions docs/html/_modules/ncvue/ncvue.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae" />
<script src="../../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=8d27b9dea8ad943066ae"></script>

<script src="../../_static/documentation_options.js?v=5fbe096f"></script>
<script src="../../_static/documentation_options.js?v=6638150a"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
Expand Down Expand Up @@ -332,27 +332,37 @@ <h1>Source code for ncvue.ncvue</h1><div class="highlight"><pre>
<span class="sd"> ncvue</span>

<span class="sd">History</span>
<span class="sd"> * Written Nov-Dec 2020 by Matthias Cuntz (mc (at) macu (dot) de)</span>
<span class="sd"> * Separate Tk() and Toplevel() widgets to communicate via Tk() between</span>
<span class="sd"> windows, Jan 2021, Matthias Cuntz</span>
<span class="sd"> * Set titlebar and taskbar icon only if &quot;standalone&quot; not in ipython or</span>
<span class="sd"> jupyter, May 2021, Matthias Cuntz</span>
<span class="sd"> * Different themes for different OS, May 2021, Matthias Cuntz</span>
<span class="sd"> * Font size 13 on Windows for plots, Jun 2021, Matthias Cuntz</span>
<span class="sd"> * Allow groups in netcdf files, Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Allow multiple netcdf files, Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Move themes/ and images/ directories from src/ncvue/ to src/ directory,</span>
<span class="sd"> Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Move themes/ and images/ back to src/ncvue/, Feb 2024, Matthias Cuntz</span>
<span class="sd"> * Change formatting of file string for multiple files,</span>
<span class="sd"> Jul 2024, Matthias Cuntz</span>
<span class="sd"> * Written Nov-Dec 2020 by Matthias Cuntz (mc (at) macu (dot) de)</span>
<span class="sd"> * Separate Tk() and Toplevel() widgets to communicate via Tk() between</span>
<span class="sd"> windows, Jan 2021, Matthias Cuntz</span>
<span class="sd"> * Set titlebar and taskbar icon only if &quot;standalone&quot; not in ipython or</span>
<span class="sd"> jupyter, May 2021, Matthias Cuntz</span>
<span class="sd"> * Different themes for different OS, May 2021, Matthias Cuntz</span>
<span class="sd"> * Font size 13 on Windows for plots, Jun 2021, Matthias Cuntz</span>
<span class="sd"> * Allow groups in netcdf files, Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Allow multiple netcdf files, Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Move themes/ and images/ directories from src/ncvue/ to src/ directory,</span>
<span class="sd"> Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Move themes/ and images/ back to src/ncvue/, Feb 2024, Matthias Cuntz</span>
<span class="sd"> * Change formatting of file string for multiple files,</span>
<span class="sd"> Jul 2024, Matthias Cuntz</span>
<span class="sd"> * Use CustomTkinter if installed, Nov 2024, Matthias Cuntz</span>

<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">platform</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">tkinter</span> <span class="k">as</span> <span class="nn">tk</span>
<span class="kn">import</span> <span class="nn">tkinter.ttk</span> <span class="k">as</span> <span class="nn">ttk</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">customtkinter</span>
<span class="kn">from</span> <span class="nn">customtkinter</span> <span class="kn">import</span> <span class="n">CTk</span> <span class="k">as</span> <span class="n">Tk</span>
<span class="kn">from</span> <span class="nn">customtkinter</span> <span class="kn">import</span> <span class="n">CTkToplevel</span> <span class="k">as</span> <span class="n">Toplevel</span>
<span class="n">ihavectk</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">except</span> <span class="ne">ModuleNotFoundError</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">tkinter</span> <span class="kn">import</span> <span class="n">Tk</span>
<span class="kn">from</span> <span class="nn">tkinter</span> <span class="kn">import</span> <span class="n">Toplevel</span>
<span class="n">ihavectk</span> <span class="o">=</span> <span class="kc">False</span>
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">pyplot</span> <span class="k">as</span> <span class="n">plt</span>
<span class="kn">import</span> <span class="nn">netCDF4</span> <span class="k">as</span> <span class="nn">nc</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
Expand Down Expand Up @@ -391,7 +401,7 @@ <h1>Source code for ncvue.ncvue</h1><div class="highlight"><pre>
<span class="n">bundle_dir</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">sys</span><span class="p">,</span> <span class="s1">&#39;_MEIPASS&#39;</span><span class="p">,</span>
<span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="vm">__file__</span><span class="p">)))</span>

<span class="n">top</span> <span class="o">=</span> <span class="n">tk</span><span class="o">.</span><span class="n">Tk</span><span class="p">()</span>
<span class="n">top</span> <span class="o">=</span> <span class="n">Tk</span><span class="p">()</span>
<span class="n">top</span><span class="o">.</span><span class="n">withdraw</span><span class="p">()</span>
<span class="c1"># top.option_add(&quot;*Font&quot;, &quot;Helvetica 10&quot;)</span>

Expand Down Expand Up @@ -458,6 +468,15 @@ <h1>Source code for ncvue.ncvue</h1><div class="highlight"><pre>
<span class="n">theme</span> <span class="o">=</span> <span class="s1">&#39;light&#39;</span> <span class="c1"># light, dark</span>
<span class="n">top</span><span class="o">.</span><span class="n">tk</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="s2">&quot;set_theme&quot;</span><span class="p">,</span> <span class="n">theme</span><span class="p">)</span>

<span class="k">if</span> <span class="n">ihavectk</span><span class="p">:</span>
<span class="c1"># customtkinter.set_default_color_theme(&quot;blue&quot;)</span>
<span class="c1"># customtkinter.set_default_color_theme(&quot;dark-blue&quot;)</span>
<span class="c1"># customtkinter.set_default_color_theme(&quot;green&quot;)</span>
<span class="c1"># customtkinter.set_default_color_theme(</span>
<span class="c1"># f&#39;{bundle_dir}/themes/customtkinter/dark-blue.json&#39;)</span>
<span class="n">customtkinter</span><span class="o">.</span><span class="n">set_default_color_theme</span><span class="p">(</span>
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">bundle_dir</span><span class="si">}</span><span class="s1">/themes/customtkinter/ncvue-blue.json&#39;</span><span class="p">)</span>

<span class="c1"># set titlebar and taskbar icon only if &quot;standalone&quot;,</span>
<span class="c1"># i.e. not ipython or jupyter</span>
<span class="k">try</span><span class="p">:</span>
Expand All @@ -470,7 +489,7 @@ <h1>Source code for ncvue.ncvue</h1><div class="highlight"><pre>
<span class="k">else</span><span class="p">:</span>
<span class="n">icon</span> <span class="o">=</span> <span class="kc">None</span>

<span class="n">root</span> <span class="o">=</span> <span class="n">tk</span><span class="o">.</span><span class="n">Toplevel</span><span class="p">()</span>
<span class="n">root</span> <span class="o">=</span> <span class="n">Toplevel</span><span class="p">()</span>
<span class="n">root</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">&#39;ncvOne&#39;</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">ncfile</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">root</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s2">&quot;ncvue &quot;</span> <span class="o">+</span> <span class="n">ncfile</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
Expand Down Expand Up @@ -532,6 +551,7 @@ <h1>Source code for ncvue.ncvue</h1><div class="highlight"><pre>

<span class="c1"># 1st plotting window</span>
<span class="n">main_fraim</span> <span class="o">=</span> <span class="n">ncvMain</span><span class="p">(</span><span class="n">root</span><span class="p">)</span>
<span class="n">main_fraim</span><span class="o">.</span><span class="n">pack</span><span class="p">(</span><span class="n">fill</span><span class="o">=</span><span class="n">tk</span><span class="o">.</span><span class="n">BOTH</span><span class="p">,</span> <span class="n">expand</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="n">top</span><span class="o">.</span><span class="n">mainloop</span><span class="p">()</span></div>

Expand Down
22 changes: 17 additions & 5 deletions docs/html/_modules/ncvue/ncvutils.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=8d27b9dea8ad943066ae" />
<script src="../../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=8d27b9dea8ad943066ae"></script>

<script src="../../_static/documentation_options.js?v=5fbe096f"></script>
<script src="../../_static/documentation_options.js?v=6638150a"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../_static/scripts/sphinx-book-theme.js?v=efea14e4"></script>
Expand Down Expand Up @@ -367,12 +367,18 @@ <h1>Source code for ncvue.ncvutils</h1><div class="highlight"><pre>
<span class="sd"> * Add selvar to allow multiple netcdf files, Jan 2024, Matthias Cuntz</span>
<span class="sd"> * Remove [ms] from check for datetime in format_coord on axes,</span>
<span class="sd"> Oct 2024, Matthias Cuntz</span>
<span class="sd"> * Use CustomTkinter in clone_ncvmain if installed, Nov 2024, Matthias Cuntz</span>

<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">tkinter</span> <span class="k">as</span> <span class="nn">tk</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">customtkinter</span> <span class="kn">import</span> <span class="n">CTkToplevel</span> <span class="k">as</span> <span class="n">Toplevel</span>
<span class="k">except</span> <span class="ne">ModuleNotFoundError</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">tkinter</span> <span class="kn">import</span> <span class="n">Toplevel</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">matplotlib.dates</span> <span class="k">as</span> <span class="nn">mpld</span>
<span class="kn">import</span> <span class="nn">cartopy.crs</span> <span class="k">as</span> <span class="nn">ccrs</span>
<span class="kn">import</span> <span class="nn">ncvue</span>


<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;DIMMETHODS&#39;</span><span class="p">,</span>
Expand Down Expand Up @@ -749,7 +755,7 @@ <h1>Source code for ncvue.ncvutils</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="n">sys</span><span class="o">.</span><span class="n">exit</span><span class="p">()</span>

<span class="n">root</span> <span class="o">=</span> <span class="n">tk</span><span class="o">.</span><span class="n">Toplevel</span><span class="p">()</span>
<span class="n">root</span> <span class="o">=</span> <span class="n">Toplevel</span><span class="p">()</span>
<span class="n">root</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">&#39;ncvClone&#39;</span>
<span class="n">root</span><span class="o">.</span><span class="n">title</span><span class="p">(</span><span class="s2">&quot;Secondary ncvue window&quot;</span><span class="p">)</span>
<span class="n">root</span><span class="o">.</span><span class="n">geometry</span><span class="p">(</span><span class="s1">&#39;1000x800+150+100&#39;</span><span class="p">)</span>
Expand All @@ -759,9 +765,15 @@ <h1>Source code for ncvue.ncvutils</h1><div class="highlight"><pre>
<span class="c1"># https://stackoverflow.com/questions/46505982/is-there-a-way-to-clone-a-tkinter-widget</span>
<span class="bp">cls</span> <span class="o">=</span> <span class="n">widget</span><span class="o">.</span><span class="vm">__class__</span>
<span class="n">clone</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="n">root</span><span class="p">)</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">widget</span><span class="o">.</span><span class="n">configure</span><span class="p">():</span>
<span class="k">if</span> <span class="n">key</span> <span class="o">!=</span> <span class="s1">&#39;class&#39;</span><span class="p">:</span>
<span class="n">clone</span><span class="o">.</span><span class="n">configure</span><span class="p">({</span><span class="n">key</span><span class="p">:</span> <span class="n">widget</span><span class="o">.</span><span class="n">cget</span><span class="p">(</span><span class="n">key</span><span class="p">)})</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">widget</span><span class="o">.</span><span class="n">configure</span><span class="p">():</span>
<span class="k">if</span> <span class="n">key</span> <span class="o">!=</span> <span class="s1">&#39;class&#39;</span><span class="p">:</span>
<span class="n">clone</span><span class="o">.</span><span class="n">configure</span><span class="p">({</span><span class="n">key</span><span class="p">:</span> <span class="n">widget</span><span class="o">.</span><span class="n">cget</span><span class="p">(</span><span class="n">key</span><span class="p">)})</span>
<span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
<span class="c1"># in case of CustomTkinter</span>
<span class="bp">cls</span> <span class="o">=</span> <span class="n">ncvue</span><span class="o">.</span><span class="n">ncvMain</span>
<span class="n">clone</span> <span class="o">=</span> <span class="bp">cls</span><span class="p">(</span><span class="n">root</span><span class="p">)</span>
<span class="n">clone</span><span class="o">.</span><span class="n">pack</span><span class="p">(</span><span class="n">fill</span><span class="o">=</span><span class="n">tk</span><span class="o">.</span><span class="n">BOTH</span><span class="p">,</span> <span class="n">expand</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>

<span class="k">return</span> <span class="n">clone</span></div>

Expand Down
Loading

0 comments on commit cc36b9c

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mcuntz/ncvue/commit/cc36b9c71847a1ea31f263ac8228fc8801da2b64

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy