<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
    <generator uri="https://gohugo.io/" version="0.152.2">Hugo</generator><title type="html"><![CDATA[News on Blog]]></title>
    
    
    
            <link href="https://blog.scientific-python.org/tags/news/" rel="alternate" type="text/html" title="html" />
            <link href="https://blog.scientific-python.org/tags/news/atom.xml" rel="self" type="application/atom" title="atom" />
    <updated>2026-04-04T04:32:36+00:00</updated>
    
    
    
    
        <id>https://blog.scientific-python.org/tags/news/</id>
    
        
        <entry>
            <title type="html"><![CDATA[NumPy 2.0: an evolutionary milestone]]></title>
            <link href="https://blog.scientific-python.org/numpy/numpy2/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/numpy/numpy-rng/?utm_source=atom_feed" rel="related" type="text/html" title="Best Practices for Using NumPy&#39;s Random Number Generators" />
                <link href="https://blog.scientific-python.org/numpy/fellowship-program/?utm_source=atom_feed" rel="related" type="text/html" title="NumPy&#39;s first Developer in Residence: Sayed Adel" />
                <link href="https://blog.scientific-python.org/numpy/mukulikapahari/?utm_source=atom_feed" rel="related" type="text/html" title="NumPy Contributor Spotlight: Mukulika Pahari" />
                <link href="https://blog.scientific-python.org/matplotlib/book/?utm_source=atom_feed" rel="related" type="text/html" title="Newly released open access book" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_final/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Final Report" />
            
                <id>https://blog.scientific-python.org/numpy/numpy2/</id>
            
            
            <published>2024-06-17T00:00:00+00:00</published>
            <updated>2024-06-17T00:00:00+00:00</updated>
            
            
            <content type="html"><![CDATA[<blockquote>We announce the release of NumPy 2.0, which brings major improvements in functionality and usability. Improvements to NumPy internals set the stage for future development. We discuss the motivation behind breaking changes and how those impact users, as well as some of the history of the 2.0 development process.</blockquote><p>Eighteen years since the release of NumPy 1.0, we are thrilled to announce the
launch of NumPy 2.0! This major release marks a significant milestone in the
evolution of NumPy, bringing a wealth of enhancements and improvements to users,
and setting the stage for future feature development.</p>
<p>NumPy has improved and evolved over the past 18 years, with many old releases bringing
significant performance, usability, and consistency improvements.
That said, our approach for a long time has been to make only incremental changes while
carefully managing backward compatibility. This approach minimizes user breakage,
but also limits the scope of improvements that can be made, both to the API and its underlying implementation.
Therefore, for this one-off major release, we are breaking backward
compatibility to implement significant improvements in NumPy&rsquo;s type system. The
type system is fundamental to NumPy, and major behavioral changes could not be
made incrementally without mixing two different
type systems, which would be a recipe for disaster.</p>
<p>The journey to an actual 2.0 release has been long, and it was difficult to
build the necessary momentum. In part, this may be because, for a time, the
NumPy developers associated a NumPy 2.0 release with nothing less than a
revolutionary rewrite of significant key pieces of the code base. Many of these
rewrites and changes happened over the years, but because of backward
compatibility concerns they remained largely invisible to the users. NumPy 2.0
is the culmination of these efforts, allowing us to discard some legacy
ABI (Application Binary Interface) that prevented future improvements.</p>
<p>Some major changes to NumPy internals—required for key features in
2.0—have been in the works since 2019 at least.
We started concrete plans for the 2.0 release more than a year ago, at a four hour
long <a href="https://github.com/numpy/archive/tree/main/2.0_developer_meeting">public planning meeting</a>
in April 2023. Many of the key changes were proposed and discussed. The key goals
we decided on there were perhaps even larger and more ambitious in scope than
some of us expected. This also unlocked some extra energy - which has been great to see.
After the meeting and over the course of the last year, NumPy enhancement
proposals (<a href="https://numpy.org/neps/">NEPs</a>) were written,
reviewed, and implemented for each major change.</p>
<p>Some key highlights are:</p>
<ul>
<li>
<p>Cleaned-up and streamlined Python API (<a href="https://numpy.org/neps/nep-0052-python-api-cleanup.html">NEP 52</a>):
The Python API has undergone a thorough cleanup, making it easier to learn
and use NumPy. The main namespace has been reduced by approximately 10%, and
the more niche <code>numpy.lib</code> namespace has been reduced by about 80%, providing
a clearer distinction between public and private API elements.</p>
</li>
<li>
<p>Improved scalar promotion rules: The scalar promotion rules have been
updated, as proposed in <a href="https://numpy.org/neps/nep-0050-scalar-promotion.html">NEP 50</a>
addressing surprising behaviors in type promotion, e.g. with zero dimensional arrays.</p>
</li>
<li>
<p>Powerful new DType API and a new string dtype: NumPy 2.0 introduces a new API
for implementing user-defined custom data types as proposed by
<a href="https://numpy.org/neps/nep-0041-improved-dtype-support.html">NEP 41</a>. We used
this new API to implement <code>StringDType</code>, offering efficient and painless
support for variable length strings which was proposed in
<a href="https://numpy.org/neps/nep-0055-string_dtype.html">NEP 55</a>. And it is our hope
that enable future new data types with interesting new capabilities in the
PyData ecosystem and in NumPy itself.</p>
</li>
<li>
<p>Windows compatibility enhancements: The default 32-bit integer representation
on Windows has been updated to 64-bit on 64-bit architectures, addressing one
of the most common problems with having NumPy work portably across operating
systems.</p>
</li>
<li>
<p>Support for the Python array API standard: This is the first release to
include full support for the array API standard (v2022.12), made possible
by the new promotion rules, APIs, and API cleanup mentioned above.
We also aligned existing APIs and behavior with the standard,
as proposed in <a href="https://numpy.org/neps/nep-0056-array-api-main-namespace.html">NEP 56</a>.</p>
</li>
</ul>
<p>These are just some of the more impactful changes in behavior and usability. In addition,
NumPy 2.0 contains significant performance and documentation improvements,
and much more - for an extensive list of changes, see
the <a href="https://numpy.org/devdocs/release/2.0.0-notes.html">NumPy 2 release notes</a>.</p>
<p>To adopt this major release, users will likely need to adjust existing code, but we
worked hard to strike a balance between improvements and ensuring that the
transition to NumPy 2.0 is as seamless as possible. We wrote a comprehensive
<a href="https://numpy.org/devdocs/numpy_2_0_migration_guide.html">migration guide</a>,
and a <a href="https://numpy.org/devdocs/numpy_2_0_migration_guide.html#ruff-plugin">ruff plugin</a>
that helps to update Python code so it will work with both NumPy 1.x and
NumPy 2.x.</p>
<p>While we do require C API users to recompile their projects to support
NumPy 2.0, we prepared for this in NumPy 1.25 already. The build process was
simplified so that you can now compile with the latest NumPy version,
and remain backward compatible.
This means that projects build with NumPy 2.x are &ldquo;magically&rdquo; compatible with
1.x. It also means that projects no longer need to build their binaries using
the oldest supported version of NumPy.</p>
<p>We knew throughout development that rolling out NumPy 2.0
would be (temporarily) disruptive, because of the backwards-incompatible API and
ABI changes. We spent an extraordinary amount of effort communicating these
changes, helping downstream projects adapt, tracking compatibility of popular
open source projects (see, e.g.,
<a href="https://github.com/numpy/numpy/issues/26191">numpy#26191</a>), and completing the
release process at limited pace to provide time for adoption. No
doubt, the next few weeks will bring to light some new challenges, however we fully expect these
to be manageable and well worth it in the long run.</p>
<p>The NumPy 2.0 release is the result of a collaborative, largely volunteer,
effort spanning many years and involving contributions from a diverse community
of developers. In addition, many of the changes above would not have been
possible without funders and institutional sponsors allowing several team members
to work on NumPy as part of their day jobs. We&rsquo;d like to acknowledge in particular:
the Gordon and Betty Moore Foundation, the Alfred P. Sloan Foundation,
NASA, NVIDIA, Quansight Labs, the Chan Zuckerberg Initiative, and Tidelift.</p>
<p>We are excited about future improvements to NumPy, many of which will be
possible due to changes in NumPy 2.0. See <a href="https://numpy.org/neps/roadmap.html">the NumPy roadmap</a>
for some features in the pipeline or on the wishlist. Let&rsquo;s
continue working together to improve NumPy and the scientific Python and PyData
ecosystem!</p>]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="numpy" label="numpy" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Newly released open access book]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/book/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_final/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Final Report" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_quarter/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Quarter Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_prequarter/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Pre-Quarter Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_midterm/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Mid-Term Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/?utm_source=atom_feed" rel="related" type="text/html" title="Aitik Gupta joins as a Student Developer under GSoC&#39;21" />
            
                <id>https://blog.scientific-python.org/matplotlib/book/</id>
            
            
            <published>2021-11-15T14:26:51+01:00</published>
            <updated>2021-11-15T14:26:51+01:00</updated>
            
            
            <content type="html"><![CDATA[<blockquote>New open access book released</blockquote><p>It&rsquo;s my great pleasure to announce that I&rsquo;ve finished my book on matplotlib and it is now freely available at <a href="https://www.labri.fr/perso/nrougier/scientific-visualization.html">www.labri.fr/perso/nrougier/scientific-visualization.html</a> while sources for the book are hosted at <a href="https://github.com/rougier/scientific-visualization-book">github.com/rougier/scientific-visualization-book</a>.</p>
<h2 id="abstract">Abstract<a class="headerlink" href="#abstract" title="Link to this heading">#</a></h2>
<p>The Python scientific visualisation landscape is huge. It is composed of a myriad of tools, ranging from the most versatile and widely used down to the more specialised and confidential. Some of these tools are community based while others are developed by companies. Some are made specifically for the web, others are for the desktop only, some deal with 3D and large data, while others target flawless 2D rendering. In this landscape, Matplotlib has a very special place. It is a versatile and powerful library that allows you to design very high quality figures, suitable for scientific publishing. It also offers a simple and intuitive interface as well as an object oriented architecture that allows you to tweak anything within a figure. Finally, it can be used as a regular graphic library in order to design non‐scientific figures. This book is organized into four parts. The first part considers the fundamental principles of the Matplotlib library. This includes reviewing the different parts that constitute a figure, the different coordinate systems, the available scales and projections, and we’ll also introduce a few concepts related to typography and colors. The second part is dedicated to the actual design of a figure. After introducing some simple rules for generating better figures, we’ll then go on to explain the Matplotlib defaults and styling system before diving on into figure layout organization. We’ll then explore the different types of plot available and see how a figure can be ornamented with different elements. The third part is dedicated to more advanced concepts, namely 3D figures, optimization &amp; animation. The fourth and final part is a collection of showcases.</p>
<h3 id="book-gallery">Book gallery<a class="headerlink" href="#book-gallery" title="Link to this heading">#</a></h3>
<p><img src="/matplotlib/book/book-gallery.png" alt="A grid of multiple plots showing how data may be visualized."></p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC'21: Final Report]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_final/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_quarter/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Quarter Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_prequarter/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Pre-Quarter Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_midterm/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Mid-Term Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/?utm_source=atom_feed" rel="related" type="text/html" title="Aitik Gupta joins as a Student Developer under GSoC&#39;21" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC 2020 Work Product - Baseline Images Problem" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_2021_final/</id>
            
            
            <published>2021-08-17T17:36:40+05:30</published>
            <updated>2021-08-17T17:36:40+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Google Summer of Code 2021: Final Report - Aitik Gupta</blockquote><p><strong><ins>Matplotlib: Revisiting Text/Font Handling</ins></strong></p>
<p>To kick things off for the final report, here&rsquo;s a <a href="https://user-images.githubusercontent.com/43996118/129448683-bc136398-afeb-40ac-bbb7-0576757baf3c.jpg">meme</a> to nudge about the <a href="/tags/gsoc/">previous blogs</a>.</p>
<h2 id="about-matplotlib">About Matplotlib<a class="headerlink" href="#about-matplotlib" title="Link to this heading">#</a></h2>
<p>Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations, which has become a <em>de-facto Python plotting library</em>.</p>
<p>Much of the implementation behind its font manager is inspired by <a href="https://www.w3.org/">W3C</a> compliant algorithms, allowing users to interact with font properties like <code>font-size</code>, <code>font-weight</code>, <code>font-family</code>, etc.</p>
<h4 id="however-the-way-matplotlib-handled-fonts-and-general-text-layout-was-not-ideal-which-is-what-summer-2021-was-all-about">However, the way Matplotlib handled fonts and general text layout was not ideal, which is what Summer 2021 was all about.<a class="headerlink" href="#however-the-way-matplotlib-handled-fonts-and-general-text-layout-was-not-ideal-which-is-what-summer-2021-was-all-about" title="Link to this heading">#</a></h4>
<blockquote>
<p>By &ldquo;not ideal&rdquo;, I do not mean that the library has design flaws, but that the design was engineered in the early 2000s, and is now <em>outdated</em>.</p>
</blockquote>
<p>(..more on this later)</p>
<h3 id="about-the-project">About the Project<a class="headerlink" href="#about-the-project" title="Link to this heading">#</a></h3>
<p>(PS: here&rsquo;s <a href="https://docs.google.com/document/d/11PrXKjMHhl0rcQB4p_W9JY_AbPCkYuoTT0t85937nB0/view#heading=h.feg5pv3x59u2">the link</a> to my GSoC proposal, if you&rsquo;re interested)</p>
<p>Overall, the project was divided into two major subgoals:</p>
<ol>
<li>Font Subsetting</li>
<li>Font Fallback</li>
</ol>
<p>But before we take each of them on, we should get an idea about some basic terminology for fonts (which are a <em>lot</em>, and are rightly <em>confusing</em>)</p>
<p>The <a href="https://github.com/matplotlib/matplotlib/pull/20346/files">PR: Clarify/Improve docs on family-names vs generic-families</a> brings about a bit of clarity about some of these terms. The next section has a linked PR which also explains the types of fonts and how that is relevant to Matplotlib.</p>
<h2 id="font-subsetting">Font Subsetting<a class="headerlink" href="#font-subsetting" title="Link to this heading">#</a></h2>
<p>An easy-to-read guide on Fonts and Matplotlib was created with <a href="https://github.com/matplotlib/matplotlib/pull/20450">PR: [Doc] Font Types and Font Subsetting</a>, which is currently live at <a href="https://matplotlib.org/devdocs/users/fonts.html">Matplotlib&rsquo;s DevDocs</a>.</p>
<p>Taking an excerpt from one of my previous blogs (and <a href="https://matplotlib.org/devdocs/users/fonts.html#subsetting">the doc</a>):</p>
<blockquote>
<p>Fonts can be considered as a collection of these glyphs, so ultimately the goal of subsetting is to find out which glyphs are <ins>required</ins> for a certain array of characters, and embed <ins>only those</ins> within the output.</p>
</blockquote>
<p>PDF, PS/EPS and SVG output document formats are special, as in <strong>the text within them can be <ins>editable</ins></strong>, i.e, one can copy/search text from documents (for eg, from a PDF file) if the text is editable.</p>
<h3 id="matplotlib-and-subsetting">Matplotlib and Subsetting<a class="headerlink" href="#matplotlib-and-subsetting" title="Link to this heading">#</a></h3>
<p>The PDF, PS/EPS and SVG backends used to support font subsetting, <em>only for a few types</em>. What that means is, before Summer &lsquo;21, Matplotlib could generate Type 3 subsets for PDF, PS/EPS backends, but it <ins><em>could not</em></ins> generate Type 42 / TrueType subsets.</p>
<p>With <a href="https://github.com/matplotlib/matplotlib/pull/20391">PR: Type42 subsetting in PS/PDF</a> merged in, users can expect their PDF/PS/EPS documents to contains subsetted glyphs from the original fonts.</p>
<p>This is especially beneficial for people who wish to use <ins>commercial</ins> (or <a href="https://en.wikipedia.org/wiki/CJK_characters">CJK</a>) fonts. Licenses for many fonts <strong><em>require</em></strong> subsetting such that they can’t be trivially copied from the output files generated from Matplotlib.</p>
<h2 id="font-fallback">Font Fallback<a class="headerlink" href="#font-fallback" title="Link to this heading">#</a></h2>
<p>Matplotlib was designed to work with a single font at runtime. A user <em>could</em> specify a <code>font.family</code>, which was supposed to correspond to <a href="https://www.w3schools.com/cssref/pr_font_font-family.asp">CSS</a> properties, but that was only used to find a <em>single</em> font present on the user&rsquo;s system.</p>
<p>Once that font was found (which is almost always found, since Matplotlib ships with a set of default fonts), all the user text was rendered only through that font. (which used to give out &ldquo;<ins>tofu</ins>&rdquo; if a character wasn&rsquo;t found)</p>
<hr>
<p>It might seem like an <em>outdated</em> approach for text rendering, now that we have these concepts like font-fallback, <ins>but these concepts weren&rsquo;t very well discussed in early 2000s</ins>. Even getting a single font to work <em>was considered a hard engineering problem</em>.</p>
<p>This was primarily because of the lack of <strong>any standardization</strong> for representation of fonts (Adobe had their own font representation, and so did Apple, Microsoft, etc.)</p>
<table>
  <thead>
      <tr>
          <th><img src="https://user-images.githubusercontent.com/43996118/128605750-9d76fa4a-ce57-45c6-af23-761334d48ef7.png" alt="Previous"></th>
          <th><img src="https://user-images.githubusercontent.com/43996118/128605746-9f79ebeb-c03d-407e-9e27-c3203a210908.png" alt="After"></th>
      </tr>
  </thead>
  <tbody>
  </tbody>
</table>
<p align="middle">
    <ins>Previous</ins> (notice <i>Tofus</i>) VS  <ins>After</ins> (CJK font as fallback)
</p>
<p>To migrate from a font-first approach to a text-first approach, there are multiple steps involved:</p>
<h3 id="parsing-the-whole-font-family">Parsing the whole font family<a class="headerlink" href="#parsing-the-whole-font-family" title="Link to this heading">#</a></h3>
<p>The very first (and crucial!) step is to get to a point where we have multiple font paths (ideally individual font files for the whole family). That is achieved with either:</p>
<ul>
<li><a href="https://github.com/matplotlib/matplotlib/pull/20496">PR: [with findfont diff] Parsing all families in font_manager</a>, or</li>
<li><a href="https://github.com/matplotlib/matplotlib/pull/20549">PR: [without findfont diff] Parsing all families in font_manager</a></li>
</ul>
<p>Quoting one of my <a href="../gsoc_2021_prequarter/">previous</a> blogs:</p>
<blockquote>
<p>Don’t break, a lot at stake!</p>
</blockquote>
<p>My first approach was to change the existing public <code>findfont</code> API to incorporate multiple filepaths. Since Matplotlib has a <em>very huge</em> userbase, there&rsquo;s a high chance it would break a chunk of people&rsquo;s workflow:</p>
<p align="center">
  <img src="https://user-images.githubusercontent.com/43996118/129636132-47b141b3-f149-49b7-b0c0-67c256bd6ee1.png" alt="FamilyParsingFlowChart" width="60%" />
  First PR (left), Second PR (right)
</p>
<h3 id="ft2font-overhaul">FT2Font Overhaul<a class="headerlink" href="#ft2font-overhaul" title="Link to this heading">#</a></h3>
<p>Once we get a list of font paths, we need to change the internal representation of a &ldquo;font&rdquo;. Matplotlib has a utility called FT2Font, which is written in C++, and used with wrappers as a Python extension, which in turn is used throughout the backends. For all intents and purposes, it used to mean: <code>FT2Font === SingleFont</code> (if you&rsquo;re interested, here&rsquo;s a <a href="https://user-images.githubusercontent.com/43996118/128352387-76a3f52a-20fc-4853-b624-0c91844fc785.png">meme</a> about how FT2Font was named!)</p>
<p>But that is not the case anymore, here&rsquo;s a flowchart to explain what happens now:</p>
<p align="center">
  <img src="https://user-images.githubusercontent.com/43996118/129720023-14f5d67f-f279-433f-ad78-e5eccb6c784a.png" alt="FamilyParsingFlowChart" width="100%" />
  Font-Fallback Algorithm
</p>
<p>With <a href="https://github.com/matplotlib/matplotlib/pull/20740">PR: Implement Font-Fallback in Matplotlib</a>, every FT2Font object has a <code>std::vector&lt;FT2Font *&gt; fallback_list</code>, which is used for filling the parent cache, as can be seen in the self-explanatory flowchart.</p>
<p>For simplicity, only one type of cache (<ins>character -&gt; FT2Font</ins>) is shown, whereas in actual implementation there&rsquo;s 2 types of caches, one shown above, and another for glyphs (<ins>glyph_id -&gt; FT2Font</ins>).</p>
<blockquote>
<p>Note: Only the parent&rsquo;s APIs are used in some backends, so for each of the individual public functions like <code>load_glyph</code>, <code>load_char</code>, <code>get_kerning</code>, etc., we find the FT2Font object which has that glyph from the parent FT2Font cache!</p>
</blockquote>
<h3 id="multi-font-embedding-in-pdfpseps">Multi-Font embedding in PDF/PS/EPS<a class="headerlink" href="#multi-font-embedding-in-pdfpseps" title="Link to this heading">#</a></h3>
<p>Now that we have multiple fonts to render a string, we also need to embed them for those special backends (i.e., PDF/PS, etc.). This was done with some patches to specific backends:</p>
<ul>
<li><a href="https://github.com/matplotlib/matplotlib/pull/20804">PR: Implement multi-font embedding for PDF Backend</a></li>
<li><a href="https://github.com/matplotlib/matplotlib/pull/20832">PR: Implement multi-font embedding for PS Backend</a></li>
</ul>
<p>With this, one could create a PDF or a PS/EPS document with multiple fonts which are embedded (and subsetted!).</p>
<h2 id="conclusion">Conclusion<a class="headerlink" href="#conclusion" title="Link to this heading">#</a></h2>
<p>From small contributions to eventually working on a core module of such a huge library, the road was not what I had imagined, and I learnt a lot while designing solutions to these problems.</p>
<h4 id="the-work-i-did-would-eventually-end-up-affecting-every-single-matplotlib-user">The work I did would eventually end up affecting every single Matplotlib user.<a class="headerlink" href="#the-work-i-did-would-eventually-end-up-affecting-every-single-matplotlib-user" title="Link to this heading">#</a></h4>
<p>&hellip;since all plots will work their way through the new codepath!</p>
<p>I think that single statement is worth the <ins>whole GSoC project</ins>.</p>
<h3 id="pull-request-statistics">Pull Request Statistics<a class="headerlink" href="#pull-request-statistics" title="Link to this heading">#</a></h3>
<p>For the sake of statistics (and to make GSoC sound a bit less intimidating), here&rsquo;s a list of contributions I made to Matplotlib <ins>before Summer &lsquo;21</ins>, most of which are only a few lines of diff:</p>
<table>
  <thead>
      <tr>
          <th style="text-align: center">Created At</th>
          <th>PR Title</th>
          <th style="text-align: center">Diff</th>
          <th style="text-align: center">Status</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td style="text-align: center">Nov 2, 2020</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/18870">Expand ScalarMappable.set_array to accept array-like inputs</a></td>
          <td style="text-align: center">(+28 −4)</td>
          <td style="text-align: center">MERGED</td>
      </tr>
      <tr>
          <td style="text-align: center">Nov 8, 2020</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/18916">Add overset and underset support for mathtext</a></td>
          <td style="text-align: center">(+71 −0)</td>
          <td style="text-align: center">MERGED</td>
      </tr>
      <tr>
          <td style="text-align: center">Nov 14, 2020</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/18947">Strictly increasing check with test coverage for streamplot grid</a></td>
          <td style="text-align: center">(+54 −2)</td>
          <td style="text-align: center">MERGED</td>
      </tr>
      <tr>
          <td style="text-align: center">Jan 11, 2021</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/19271">WIP: Add support to edit subplot configurations via textbox</a></td>
          <td style="text-align: center">(+51 −11)</td>
          <td style="text-align: center">DRAFT</td>
      </tr>
      <tr>
          <td style="text-align: center">Jan 18, 2021</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/19314">Fix over/under mathtext symbols</a></td>
          <td style="text-align: center">(+7,459 −4,169)</td>
          <td style="text-align: center">MERGED</td>
      </tr>
      <tr>
          <td style="text-align: center">Feb 11, 2021</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/19497">Add overset/underset whatsnew entry</a></td>
          <td style="text-align: center">(+28 −17)</td>
          <td style="text-align: center">MERGED</td>
      </tr>
      <tr>
          <td style="text-align: center">May 15, 2021</td>
          <td><a href="https://github.com/matplotlib/matplotlib/pull/20235">Warn user when mathtext font is used for ticks</a></td>
          <td style="text-align: center">(+28 −0)</td>
          <td style="text-align: center">MERGED</td>
      </tr>
  </tbody>
</table>
<p>Here&rsquo;s a list of PRs I opened <ins>during Summer'21</ins>:</p>
<ul>
<li>[Status: ✅] <a href="https://github.com/matplotlib/matplotlib/pull/20346">Clarify/Improve docs on family-names vs generic-families</a></li>
<li>[Status: ✅] <a href="https://github.com/matplotlib/matplotlib/pull/20367">Add parse_math in Text and default it False for TextBox</a></li>
<li>[Status: ✅] <a href="https://github.com/matplotlib/matplotlib/pull/20391">Type42 subsetting in PS/PDF</a></li>
<li>[Status: ✅] <a href="https://github.com/matplotlib/matplotlib/pull/20450">[Doc] Font Types and Font Subsetting</a></li>
<li>[Status: 🚧] <a href="https://github.com/matplotlib/matplotlib/pull/20496">[with findfont diff] Parsing all families in font_manager</a></li>
<li>[Status: 🚧] <a href="https://github.com/matplotlib/matplotlib/pull/20549">[without findfont diff] Parsing all families in font_manager</a></li>
<li>[Status: 🚧] <a href="https://github.com/matplotlib/matplotlib/pull/20740">Implement Font-Fallback in Matplotlib</a></li>
<li>[Status: 🚧] <a href="https://github.com/matplotlib/matplotlib/pull/20804">Implement multi-font embedding for PDF Backend</a></li>
<li>[Status: 🚧] <a href="https://github.com/matplotlib/matplotlib/pull/20832">Implement multi-font embedding for PS Backend</a></li>
</ul>
<h2 id="acknowledgements">Acknowledgements<a class="headerlink" href="#acknowledgements" title="Link to this heading">#</a></h2>
<p>From learning about software engineering fundamentals from <a href="https://github.com/tacaswell">Tom</a> to learning about nitty-gritty details about font representations from <a href="https://github.com/jkseppan">Jouni</a>;</p>
<p>From learning through <a href="https://github.com/anntzer">Antony</a>&rsquo;s patches and pointers to receiving amazing feedback on these blogs from <a href="https://github.com/story645">Hannah</a>, it has been an adventure! 💯</p>
<p><em>Special Mentions: <a href="https://github.com/sauerburger">Frank</a>, <a href="https://github.com/srijan-paul">Srijan</a> and <a href="https://github.com/tfidfwastaken">Atharva</a> for their helping hands!</em></p>
<p>And lastly, <em>you</em>, the reader; if you&rsquo;ve been following my <a href="/tags/gsoc/">previous blogs</a>, or if you&rsquo;ve landed at this one directly, I thank you nevertheless. (one last <a href="https://user-images.githubusercontent.com/43996118/126441988-5a2067fd-055e-44e5-86e9-4dddf47abc9d.png">meme</a>, I promise!)</p>
<p>I know I speak for every developer out there, when I say <ins><strong><em>it means a lot</em></strong></ins> when you choose to look at their journey or their work product; it could as well be a tiny website, or it could be as big as designing a complete library!</p>
<hr>
<blockquote>
<p>I&rsquo;m grateful to <a href="https://matplotlib.org/">Maptlotlib</a> (under the parent organisation: <a href="https://numfocus.org/">NumFOCUS</a>), and of course, <a href="https://summerofcode.withgoogle.com/">Google Summer of Code</a> for this incredible learning opportunity.</p>
</blockquote>
<p>Farewell, reader! :&rsquo;)</p>
<p align="center">
  <img src="https://user-images.githubusercontent.com/43996118/118876008-5e6dd580-b90a-11eb-96db-0abc930c6993.png" alt="MatplotlibGSoC" />
  Consider contributing to Matplotlib (Open Source in general) ❤️
</p>
<h4 id="note-this-blog-post-is-also-available-at-my-personal-website">NOTE: This blog post is also available at my <a href="https://aitikgupta.github.io/gsoc-final/">personal website</a>.<a class="headerlink" href="#note-this-blog-post-is-also-available-at-my-personal-website" title="Link to this heading">#</a></h4>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC'21: Quarter Progress]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_quarter/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_prequarter/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Pre-Quarter Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_midterm/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Mid-Term Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/?utm_source=atom_feed" rel="related" type="text/html" title="Aitik Gupta joins as a Student Developer under GSoC&#39;21" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC 2020 Work Product - Baseline Images Problem" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 3 Blog 1" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_2021_quarter/</id>
            
            
            <published>2021-08-03T18:48:00+05:30</published>
            <updated>2021-08-03T18:48:00+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Quarter Progress with Google Summer of Code 2021 project under NumFOCUS: Aitik Gupta</blockquote><p><strong>“<ins>Matplotlib, I want 多个汉字 in between my text.</ins>”</strong></p>
<p>Let&rsquo;s say you asked Matplotlib to render a plot with some label containing 多个汉字 (multiple Chinese characters) in between your English text.</p>
<p>Or conversely, let&rsquo;s say you use a Chinese font with Matplotlib, but you had English text in between (which is quite common).</p>
<blockquote>
<p>Assumption: the Chinese font doesn&rsquo;t have those English glyphs, and vice versa</p>
</blockquote>
<p>With this short writeup, I&rsquo;ll talk about how does a migration from a font-first to a text-first approach in Matplotlib looks like, which ideally solves the above problem.</p>
<h3 id="have-the-fonts">Have the fonts?<a class="headerlink" href="#have-the-fonts" title="Link to this heading">#</a></h3>
<p>Logically, the very first step to solving this would be to ask whether you <em>have</em> multiple fonts, right?</p>
<p>Matplotlib doesn&rsquo;t ship <a href="https://en.wikipedia.org/wiki/List_of_CJK_fonts">CJK</a> (Chinese Japanese Korean) fonts, which ideally contains these Chinese glyphs. It does try to cover most grounds with the <a href="https://matplotlib.org/stable/users/dflt_style_changes.html#normal-text">default font</a> it ships with, however.</p>
<p>So if you don&rsquo;t have a font to render your Chinese characters, go ahead and install one! Matplotlib will find your installed fonts (after rebuilding the cache, that is).</p>
<h3 id="parse-the-fonts">Parse the fonts<a class="headerlink" href="#parse-the-fonts" title="Link to this heading">#</a></h3>
<p>This is where things get interesting, and what my <a href="../gsoc_2021_prequarter/">previous writeup</a> was all about..</p>
<blockquote>
<p>Parsing the whole family to get multiple fonts for given font properties</p>
</blockquote>
<h2 id="ft2font-magic">FT2Font Magic!<a class="headerlink" href="#ft2font-magic" title="Link to this heading">#</a></h2>
<p>To give you an idea about how things used to work for Matplotlib:</p>
<ol>
<li>A single font was chosen <em>at draw time</em>
(fixed: re <a href="../gsoc_2021_prequarter/">previous writeup</a>)</li>
<li>Every character displayed in your document was rendered by only that font
(partially fixed: re <ins><em>this writeup</em></ins>)</li>
</ol>
<blockquote>
<p>FT2Font is a matplotlib-to-font module, which provides high-level Python API to interact with a <em>single font&rsquo;s operations</em> like read/draw/extract/etc.</p>
</blockquote>
<p>Being written in C++, the module needs wrappers around it to be converted into a <a href="https://docs.python.org/3/extending/extending.html">Python extension</a> using Python&rsquo;s C-API.</p>
<blockquote>
<p>It allows us to use C++ functions directly from Python!</p>
</blockquote>
<p>So wherever you see a use of font within the library (by library I mean the readable Python codebase XD), you could have derived that:</p>

<div class="highlight">
  <pre>FT2Font === SingleFont</pre>
</div>

<p>Things are be a bit different now however..</p>
<h2 id="designing-a-multi-font-system">Designing a multi-font system<a class="headerlink" href="#designing-a-multi-font-system" title="Link to this heading">#</a></h2>
<p>FT2Font is basically itself a wrapper around a library called <a href="https://www.freetype.org/">FreeType</a>, which is a freely available software library to render fonts.</p>
<p align="center">
    <figure>
        <img src="https://user-images.githubusercontent.com/43996118/128352387-76a3f52a-20fc-4853-b624-0c91844fc785.png" alt="FT2Font Naming" />
        <figcaption style="text-align: center; font-style: italic;">How FT2Font was named</figcaption>
    </figure>
</p>
<p>In my initial proposal.. while looking around how FT2Font is structured, I figured:</p>

<div class="highlight">
  <pre>Oh, looks like all we need are Faces!</pre>
</div>

<blockquote>
<p>If you don&rsquo;t know what faces/glyphs/ligatures are, head over to why <a href="https://gankra.github.io/blah/text-hates-you/">Text Hates You</a>. I can guarantee you&rsquo;ll definitely enjoy some real life examples of why text rendering is hard. 🥲</p>
</blockquote>
<p>Anyway, if you already know what Faces are, it might strike you:</p>
<p>If we already have all the faces we need from multiple fonts (let&rsquo;s say we created a child of FT2Font.. which only <ins>tracks the faces</ins> for its families), we should be able to render everything from that parent FT2Font right?</p>
<p>As I later figured out while finding segfaults in implementing this design:</p>

<div class="highlight">
  <pre>Each FT2Font is linked to a single FT_Library object!</pre>
</div>

<p>If you tried to load the face/glyph/character (basically anything) from a different FT2Font object.. you&rsquo;ll run into serious segfaults. (because one object linked to an <code>FT_Library</code> can&rsquo;t really access another object which has it&rsquo;s own <code>FT_Library</code>)</p>


<div class="highlight">
  <pre class="chroma"><code><span class="line"><span class="cl"><span class="c1">// face is linked to FT2Font; which is
</span></span></span><span class="line"><span class="cl"><span class="c1">// linked to a single FT_Library object
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="n">FT_Face</span> <span class="n">face</span> <span class="o">=</span> <span class="k">this</span><span class="o">-&gt;</span><span class="n">get_face</span><span class="p">();</span>
</span></span><span class="line"><span class="cl"><span class="n">FT_Get_Glyph</span><span class="p">(</span><span class="n">face</span><span class="o">-&gt;</span><span class="n">glyph</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">placeholder</span><span class="p">);</span> <span class="c1">// works like a charm
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>
</span></span><span class="line"><span class="cl"><span class="c1">// somehow get another FT2Font&#39;s face
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="n">FT_Face</span> <span class="n">family_face</span> <span class="o">=</span> <span class="k">this</span><span class="o">-&gt;</span><span class="n">get_family_member</span><span class="p">()</span><span class="o">-&gt;</span><span class="n">get_face</span><span class="p">();</span>
</span></span><span class="line"><span class="cl"><span class="n">FT_Get_Glyph</span><span class="p">(</span><span class="n">family_face</span><span class="o">-&gt;</span><span class="n">glyph</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">placeholder</span><span class="p">);</span> <span class="c1">// segfaults!
</span></span></span></code></pre>
</div>
<p>Realizing this took a good amount of time! After this I quickly came up with a recursive approach, wherein we:</p>
<ol>
<li>Create a list of FT2Font objects within Python, and pass it down to FT2Font</li>
<li>FT2Font will hold pointers to its families via a <br>
<code>std::vector&lt;FT2Font *&gt; fallback_list</code></li>
<li>Find if the character we want is available in the current font
<ol>
<li>If the character is available, use that FT2Font to render that character</li>
<li>If the character isn&rsquo;t found, go to step 3 again, but now iterate through the <code>fallback_list</code></li>
</ol>
</li>
<li>That&rsquo;s it!</li>
</ol>
<p>A quick overhaul of the above piece of code^</p>


<div class="highlight">
  <pre class="chroma"><code><span class="line"><span class="cl"><span class="kt">bool</span> <span class="nf">ft_get_glyph</span><span class="p">(</span><span class="n">FT_Glyph</span> <span class="o">&amp;</span><span class="n">placeholder</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">	<span class="n">FT_Error</span> <span class="n">not_found</span> <span class="o">=</span> <span class="n">FT_Get_Glyph</span><span class="p">(</span><span class="k">this</span><span class="o">-&gt;</span><span class="n">get_face</span><span class="p">(),</span> <span class="o">&amp;</span><span class="n">placeholder</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">	<span class="k">if</span> <span class="p">(</span><span class="n">not_found</span><span class="p">)</span> <span class="k">return</span> <span class="n">False</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">	<span class="k">else</span> <span class="k">return</span> <span class="n">True</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1">// within driver code
</span></span></span><span class="line"><span class="cl"><span class="c1"></span><span class="k">for</span> <span class="p">(</span><span class="n">uint</span> <span class="n">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="n">i</span><span class="o">&lt;</span><span class="n">fallback_list</span><span class="p">.</span><span class="n">size</span><span class="p">();</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">	<span class="c1">// iterate through all FT2Font objects
</span></span></span><span class="line"><span class="cl"><span class="c1"></span>	<span class="kt">bool</span> <span class="n">was_found</span> <span class="o">=</span> <span class="n">fallback_list</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-&gt;</span><span class="n">ft_get_glyph</span><span class="p">(</span><span class="n">placeholder</span><span class="p">);</span>
</span></span><span class="line"><span class="cl">	<span class="k">if</span> <span class="p">(</span><span class="n">was_found</span><span class="p">)</span> <span class="k">break</span><span class="p">;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre>
</div>
<p>With the idea surrounding this implementation, the <a href="https://matplotlib.org/stable/api/backend_agg_api.html">Agg backend</a> is able to render a document (either through GUI, or a PNG) with multiple fonts!</p>
<p align="center">
    <figure>
        <img src="https://user-images.githubusercontent.com/43996118/128347495-1f4f858d-33d3-4119-8732-5b26c4e9ca2a.png" alt="ChineseInBetween" />
        <figcaption style="text-align: center; font-style: italic;">PNG straight outta Matplotlib!</figcaption>
    </figure>
</p>
<h2 id="python-c-api-is-hard-at-first">Python C-API is hard, at first!<a class="headerlink" href="#python-c-api-is-hard-at-first" title="Link to this heading">#</a></h2>
<p>I&rsquo;ve spent days at Python C-API&rsquo;s <a href="https://docs.python.org/3/c-api/arg.html">argument doc</a>, and it&rsquo;s hard to get what you need at first, ngl.</p>
<p>But, with the help of some amazing people in the GSoC community (<a href="https://srijan-paul.github.io/">@srijan-paul</a>, <a href="https://atharvaraykar.me/">@atharvaraykar</a>) and amazing mentors, blockers begone!</p>
<h2 id="so-are-we-done">So are we done?<a class="headerlink" href="#so-are-we-done" title="Link to this heading">#</a></h2>
<p>Oh no. XD</p>
<p>Things work just fine for the Agg backend, but to generate a PDF/PS/SVG with multiple fonts is another story altogether! I think I&rsquo;ll save that for later.</p>
<p align="center">
    <figure>
        <img src="https://user-images.githubusercontent.com/43996118/128350093-13695b91-5ad2-4f96-91f5-8373ee7a189e.gif" alt="ThankYouDwight" />
        <figcaption style="text-align: center; font-style: italic;">If you've been following the progress so far, mayn you're awesome!</figcaption>
    </figure>
</p>
<h4 id="note-this-blog-post-is-also-available-at-my-personal-website">NOTE: This blog post is also available at my <a href="https://aitikgupta.github.io/gsoc-quarter/">personal website</a>.<a class="headerlink" href="#note-this-blog-post-is-also-available-at-my-personal-website" title="Link to this heading">#</a></h4>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC'21: Pre-Quarter Progress]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_prequarter/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_midterm/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC&#39;21: Mid-Term Progress" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/?utm_source=atom_feed" rel="related" type="text/html" title="Aitik Gupta joins as a Student Developer under GSoC&#39;21" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC 2020 Work Product - Baseline Images Problem" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 3 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 2" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_2021_prequarter/</id>
            
            
            <published>2021-07-19T07:32:05+05:30</published>
            <updated>2021-07-19T07:32:05+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Pre-Quarter Progress with Google Summer of Code 2021 project under NumFOCUS: Aitik Gupta</blockquote><p><strong>“<ins>Well? Did you get it working?!</ins>”</strong></p>
<p>Before I answer that question, if you&rsquo;re missing the context, check out my <a href="../gsoc_2021_midterm/">previous blog</a>&rsquo;s last few lines.. promise it won&rsquo;t take you more than 30 seconds to get the whole problem!</p>
<p>With this short writeup, I intend to talk about <em>what</em> we did and <em>why</em> we did, what we did. XD</p>
<h2 id="ostrich-algorithm">Ostrich Algorithm<a class="headerlink" href="#ostrich-algorithm" title="Link to this heading">#</a></h2>
<p>Ring any bells? Remember OS (Operating Systems)? It&rsquo;s one of the core CS subjects which I bunked then and regret now. (╥﹏╥)</p>
<p>The <a href="https://en.wikipedia.org/wiki/Ostrich_algorithm">wikipedia page</a> has a 2-liner explanation if you have no idea what&rsquo;s an Ostrich Algorithm.. but I know most of y&rsquo;all won&rsquo;t bother clicking it XD, so here goes:</p>
<blockquote>
<p>Ostrich algorithm is a strategy of ignoring potential problems by &ldquo;sticking one&rsquo;s head in the sand and pretending there is no problem&rdquo;</p>
</blockquote>
<p>An important thing to note: it is used when it is more <strong>cost-effective</strong> to <em>allow the problem to occur than to attempt its prevention</em>.</p>
<p>As you might&rsquo;ve guessed by now, we ultimately ended up with the <em>not-so-clean</em> API (more on this later).</p>
<h2 id="what-was-the-problem">What was the problem?<a class="headerlink" href="#what-was-the-problem" title="Link to this heading">#</a></h2>
<p>The highest level overview of the problem was:</p>

<div class="highlight">
  <pre>❌ fontTools -&gt; buffer -&gt; ttconv_with_buffer
✅ fontTools -&gt; buffer -&gt; tempfile -&gt; ttconv_with_file</pre>
</div>

<p>The first approach created corrupted outputs, however the second approach worked fine. A point to note here would be that <em>Method 1</em> is better in terms of separation of <em>reading</em> the file from <em>parsing</em> the data.</p>
<ol>
<li><a href="https://github.com/fonttools/fonttools">fontTools</a> handles the Type42 subsetting for us, whereas <a href="https://github.com/matplotlib/matplotlib/tree/master/extern/ttconv">ttconv</a> handles the embedding.</li>
<li><code>ttconv_with_buffer</code> is a modification to the original <code>ttconv_with_file</code>; that allows it to input a file buffer instead of a file-path</li>
</ol>
<p>You might be tempted to say:</p>
<blockquote>
<p>&ldquo;Well, <code>ttconv_with_buffer</code> must be wrongly modified, duh.&rdquo;</p>
</blockquote>
<p>Logically, yes. <code>ttconv</code> was designed to work with a file-path and not a file-object (buffer), and modifying a codebase <strong>written in 1998</strong> turned out to be a larger pain than we anticipated.</p>
<h4 id="it-came-to-a-point-where-one-of-my-mentors-decided-to-implement-everything-in-python">It came to a point where one of my mentors decided to implement everything in Python!<a class="headerlink" href="#it-came-to-a-point-where-one-of-my-mentors-decided-to-implement-everything-in-python" title="Link to this heading">#</a></h4>
<p>He even did, but <ins>the efforts</ins> to get it to production / or to fix <code>ttconv</code> embedding were ⋙ to just get on with the second method. That damn ostrich really helped us get out of that debugging hell. 🙃</p>
<h2 id="font-fallback---initial-steps">Font Fallback - initial steps<a class="headerlink" href="#font-fallback---initial-steps" title="Link to this heading">#</a></h2>
<p>Finally, we&rsquo;re onto the second subgoal for the summer: <a href="https://www.w3schools.com/css/css_font_fallbacks.asp">Font Fallback</a>!</p>
<p>To give an idea about how things work right now:</p>
<ol>
<li>User asks Matplotlib to use certain font families, specified by:</li>
</ol>


<div class="highlight">
  <pre class="chroma"><code><span class="line"><span class="cl"><span class="n">matplotlib</span><span class="o">.</span><span class="n">rcParams</span><span class="p">[</span><span class="s2">&#34;font-family&#34;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&#34;list&#34;</span><span class="p">,</span> <span class="s2">&#34;of&#34;</span><span class="p">,</span> <span class="s2">&#34;font&#34;</span><span class="p">,</span> <span class="s2">&#34;families&#34;</span><span class="p">]</span></span></span></code></pre>
</div>
<ol start="2">
<li>This list is used to search for available fonts on a user&rsquo;s system.</li>
<li>However, in current (and previous) versions of Matplotlib:
<blockquote>
<p><ins>As soon as a font is found by iterating the font-family, <strong>all text</strong> is rendered by that <em>and only that</em> font.</ins></p>
</blockquote>
</li>
</ol>
<p>You can immediately see the problems with this approach; using the same font for every character will not render any glyph which isn&rsquo;t present in that font, and will instead spit out a square rectangle called &ldquo;tofu&rdquo; (read the first line <a href="https://www.google.com/get/noto/">here</a>).</p>
<p>And that is exactly the first milestone! That is, parsing the <em><ins>entire list</ins></em> of font families to get an intermediate representation of a multi-font interface.</p>
<h2 id="dont-break-a-lot-at-stake">Don&rsquo;t break, a lot at stake!<a class="headerlink" href="#dont-break-a-lot-at-stake" title="Link to this heading">#</a></h2>
<p>Imagine if you had the superpower to change Python standard library&rsquo;s internal functions, <em>without</em> consulting anybody. Let&rsquo;s say you wanted to write a solution by hooking in and changing, let&rsquo;s say <code>str(&quot;dumb&quot;)</code> implementation by returning:</p>

<div class="highlight">
  <pre>&gt;&gt;&gt; str(&#34;dumb&#34;)
[&#34;d&#34;, &#34;u&#34;, &#34;m&#34;, &#34;b&#34;]</pre>
</div>

<p>Pretty &ldquo;<ins>dumb</ins>&rdquo;, right? xD</p>
<p>For your usecase it might work fine, but it would also mean breaking the <em>entire</em> Python userbase&rsquo; workflow, not to mention the 1000000+ libraries that depend on the original functionality.</p>
<p>On a similar note, Matplotlib has a public API known as <code>findfont(prop: str)</code>, which when given a string (or <a href="https://matplotlib.org/stable/api/font_manager_api.html#matplotlib.font_manager.FontProperties">FontProperties</a>) finds you a font that best matches the given properties in your system.</p>
<p>It is used <ins>throughout the library</ins>, as well as at multiple other places, including downstream libraries. Being naive as I was, I changed this function signature and submitted the <a href="https://github.com/matplotlib/matplotlib/pull/20496">PR</a>. 🥲</p>
<p>Had an insightful discussion about this with my mentors, and soon enough raised the <a href="https://github.com/matplotlib/matplotlib/pull/20549">other PR</a>, which didn&rsquo;t touch the <code>findfont</code> API at all.</p>
<hr>
<p>One last thing to note: Even if we do complete the first milestone, we wouldn&rsquo;t be done yet, since this is just parsing the entire list to get multiple fonts..</p>
<p>We still need to migrate the library&rsquo;s internal implementation from <strong>font-first</strong> to <strong>text-first</strong>!</p>
<p>But that&rsquo;s for later, for now:
<img src="https://user-images.githubusercontent.com/43996118/126441988-5a2067fd-055e-44e5-86e9-4dddf47abc9d.png" alt="Bernie Sanders with text that read ‘I am once again thanking you for reading.’"></p>
<h4 id="note-this-blog-post-is-also-available-at-my-personal-website">NOTE: This blog post is also available at my <a href="https://aitikgupta.github.io/gsoc-pre-quarter/">personal website</a>.<a class="headerlink" href="#note-this-blog-post-is-also-available-at-my-personal-website" title="Link to this heading">#</a></h4>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC'21: Mid-Term Progress]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_midterm/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/?utm_source=atom_feed" rel="related" type="text/html" title="Aitik Gupta joins as a Student Developer under GSoC&#39;21" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC 2020 Work Product - Baseline Images Problem" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 3 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 1" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_2021_midterm/</id>
            
            
            <published>2021-07-02T08:32:05+05:30</published>
            <updated>2021-07-02T08:32:05+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Mid-Term Progress with Google Summer of Code 2021 project under NumFOCUS: Aitik Gupta</blockquote><p><strong>&quot;<ins>Aitik, how is your GSoC going?</ins>&quot;</strong></p>
<p>Well, it&rsquo;s been a while since I last wrote. But I wasn&rsquo;t spending time watching <em>Loki</em> either! (that&rsquo;s a lie.)</p>
<p>During this period the project took on some interesting (and stressful) curves, which I intend to talk about in this small writeup.</p>
<h2 id="new-mentor">New Mentor!<a class="headerlink" href="#new-mentor" title="Link to this heading">#</a></h2>
<p>The first week of coding period, and I met one of my new mentors, <a href="https://github.com/jkseppan">Jouni</a>. Without him, along with <a href="https://github.com/tacaswell">Tom</a> and <a href="https://github.com/anntzer">Antony</a>, the project wouldn&rsquo;t have moved <em>an inch</em>.</p>
<p>It was initially Jouni&rsquo;s <a href="https://github.com/matplotlib/matplotlib/pull/18143">PR</a> which was my starting point of the first milestone in my proposal, <ins>Font Subsetting</ins>.</p>
<h2 id="what-is-font-subsetting-anyway">What is Font Subsetting anyway?<a class="headerlink" href="#what-is-font-subsetting-anyway" title="Link to this heading">#</a></h2>
<p>As was proposed by Tom, a good way to understand something is to document your journey along the way! (well, that&rsquo;s what GSoC wants us to follow anyway right?)</p>
<p>Taking an excerpt from one of the paragraphs I wrote <a href="https://github.com/matplotlib/matplotlib/blob/a94f52121cea4194a5d6f6fc94eafdfb03394628/doc/users/fonts.rst#subsetting">here</a>:</p>
<blockquote>
<p>Font Subsetting can be used before generating documents, to embed only the <em>required</em> glyphs within the documents. Fonts can be considered as a collection of these glyphs, so ultimately the goal of subsetting is to find out which glyphs are required for a certain array of characters, and embed only those within the output.</p>
</blockquote>
<p>Now this may seem straightforward, right?</p>
<h4 id="wrong">Wrong.<a class="headerlink" href="#wrong" title="Link to this heading">#</a></h4>
<p>The glyph programs can call their own subprograms, for example, characters like <code>ä</code> could be composed by calling subprograms for <code>a</code> and <code>¨</code>; or <code>→</code> could be composed by a program that changes the display matrix and calls the subprogram for <code>←</code>.</p>
<p>Since the subsetter has to find out <em>all such subprograms</em> being called by <em>every glyph</em> included in the subset, this is a generally difficult problem!</p>
<p>Something which one of my mentors said which <em>really</em> stuck with me:</p>
<blockquote>
<p>Matplotlib isn&rsquo;t a font library, and shouldn&rsquo;t try to be one.</p>
</blockquote>
<p>It&rsquo;s really easy to fall into the trap of trying to do <em>everything</em> within your own project, which ends up rather <em>hurting</em> itself.</p>
<p>Since this holds true even for Matplotlib, it uses external dependencies like <a href="https://www.freetype.org/">FreeType</a>, <a href="https://github.com/sandflow/ttconv">ttconv</a>, and newly proposed <a href="https://github.com/fonttools/fonttools">fontTools</a> to handle font subsetting, embedding, rendering, and related stuff.</p>
<p>PS: If that font stuff didn&rsquo;t make sense, I would recommend going through a friendly tutorial I wrote, which is all about <a href="https://matplotlib.org/stable/users/fonts.html">Matplotlib and Fonts</a>!</p>
<h2 id="unexpected-complications">Unexpected Complications<a class="headerlink" href="#unexpected-complications" title="Link to this heading">#</a></h2>
<p>Matplotlib uses an external dependency <code>ttconv</code> which was initially forked into Matplotlib&rsquo;s repository <strong>in 2003</strong>!</p>
<blockquote>
<p>ttconv was a standalone commandline utility for converting TrueType fonts to subsetted Type 3 fonts (among other features) written in 1995, which Matplotlib forked in order to make it work as a library.</p>
</blockquote>
<p>Over the time, there were a lot of issues with it which were either hard to fix, or didn&rsquo;t attract a lot of attention. (See the above paragraph for a valid reason)</p>
<p>One major utility which is still used is <code>convert_ttf_to_ps</code>, which takes a <em>font path</em> as input and converts it into a Type 3 or Type 42 PostScript font, which can be embedded within PS/EPS output documents. The guide I wrote (<a href="https://matplotlib.org/stable/users/fonts.html">link</a>) contains decent descriptions, the differences between these type of fonts, etc.</p>
<h4 id="so-we-need-to-convert-that-font-path-input-to-a-font-buffer-input">So we need to convert that <em>font path</em> input to a <em>font buffer</em> input.<a class="headerlink" href="#so-we-need-to-convert-that-font-path-input-to-a-font-buffer-input" title="Link to this heading">#</a></h4>
<p>Why do we need to? Type 42 subsetting isn&rsquo;t really supported by ttconv, so we use a new dependency called fontTools, whose &lsquo;full-time job&rsquo; is to subset Type 42 fonts for us (among other things).</p>
<blockquote>
<p>It provides us with a font buffer, however ttconv expects a font path to embed that font</p>
</blockquote>
<p>Easily enough, this can be done by Python&rsquo;s <code>tempfile.NamedTemporaryFile</code>:</p>


<div class="highlight">
  <pre class="chroma"><code><span class="line"><span class="cl"><span class="k">with</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">NamedTemporaryFile</span><span class="p">(</span><span class="n">suffix</span><span class="o">=</span><span class="s2">&#34;.ttf&#34;</span><span class="p">)</span> <span class="k">as</span> <span class="n">tmp</span><span class="p">:</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># fontdata is the subsetted buffer</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># returned from fontTools</span>
</span></span><span class="line"><span class="cl">    <span class="n">tmp</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">fontdata</span><span class="o">.</span><span class="n">getvalue</span><span class="p">())</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="c1"># TODO: allow convert_ttf_to_ps</span>
</span></span><span class="line"><span class="cl">    <span class="c1"># to input file objects (BytesIO)</span>
</span></span><span class="line"><span class="cl">    <span class="n">convert_ttf_to_ps</span><span class="p">(</span>
</span></span><span class="line"><span class="cl">        <span class="n">os</span><span class="o">.</span><span class="n">fsencode</span><span class="p">(</span><span class="n">tmp</span><span class="o">.</span><span class="n">name</span><span class="p">),</span>
</span></span><span class="line"><span class="cl">        <span class="n">fh</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">fonttype</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">        <span class="n">glyph_ids</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="p">)</span></span></span></code></pre>
</div>
<p><strong><em>But this is far from a clean API; in terms of separation of *reading* the file from *parsing* the data.</em></strong></p>
<p>What we <em>ideally</em> want is to pass the buffer down to <code>convert_ttf_to_ps</code>, and modify the embedding code of <code>ttconv</code> (written in C++). And <em>here</em> we come across a lot of unexplored codebase, <em>which wasn&rsquo;t touched a lot ever since it was forked</em>.</p>
<p>Funnily enough, just yesterday, after spending a lot of quality time, me and my mentors figured out that the <strong>whole logging system of ttconv was broken</strong>, all because of a single debugging function. 🥲</p>
<hr>
<p>This is still an ongoing problem that we need to tackle over the coming weeks, hopefully by the next time I write one of these blogs, it gets resolved!</p>
<p>Again, thanks a ton for spending time reading these blogs. :D</p>
<h4 id="note-this-blog-post-is-also-available-at-my-personal-website">NOTE: This blog post is also available at my <a href="https://aitikgupta.github.io/gsoc-mid/">personal website</a>.<a class="headerlink" href="#note-this-blog-post-is-also-available-at-my-personal-website" title="Link to this heading">#</a></h4>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Aitik Gupta joins as a Student Developer under GSoC'21]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC 2020 Work Product - Baseline Images Problem" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 3 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 2" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_2021_introduction/</id>
            
            
            <published>2021-05-19T20:03:57+05:30</published>
            <updated>2021-05-19T20:03:57+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Introduction about Aitik Gupta, Google Summer of Code 2021 Intern under the parent organisation: NumFOCUS</blockquote><p><strong><ins>The day of result, was a very, very long day.</ins></strong></p>
<p>With this small writeup, I intend to talk about everything before <em>that day</em>, my experiences, my journey, and the role of Matplotlib throughout!</p>
<h2 id="about-me">About Me<a class="headerlink" href="#about-me" title="Link to this heading">#</a></h2>
<p>I am a third-year undergraduate student currently pursuing a Dual Degree (B.Tech + M.Tech) in Information Technology at Indian Institute of Information Technology, Gwalior.</p>
<p>During my sophomore year, my interests started expanding in the domain of Machine Learning, where I learnt about various amazing open-source libraries like <em>NumPy</em>, <em>SciPy</em>, <em>pandas</em>, and <em>Matplotlib</em>! Gradually, in my third year, I explored the field of Computer Vision during my internship at a startup, where a big chunk of my work was to integrate their native C++ codebase to Android via JNI calls.</p>
<p>To actuate my learnings from the internship, I worked upon my own research along with a <a href="https://linkedin.com/in/aaditagarwal">friend from my university</a>. The paper was accepted in CoDS-COMAD’21 and is published at ACM Digital Library. (<a href="https://dl.acm.org/doi/abs/10.1145/3430984.3430986">Link</a>, if anyone&rsquo;s interested)</p>
<p>During this period, I also picked up the knack for open-source and started glaring at various issues (and pull requests) in libraries, including OpenCV [<a href="https://github.com/opencv/opencv/issues?q=author%3Aaitikgupta&#43;">contributions</a>] and NumPy [<a href="https://github.com/numpy/numpy/issues?q=author%3Aaitikgupta&#43;">contributions</a>].</p>
<p>I quickly got involved in Matplotlib’s community; it was very welcoming and beginner-friendly.</p>
<p><strong>Fun fact: Its dev call was the very first I attended with people from all around the world!</strong></p>
<h2 id="first-contributions">First Contributions<a class="headerlink" href="#first-contributions" title="Link to this heading">#</a></h2>
<p>We all mess up, my <a href="https://github.com/opencv/opencv/pull/18440">very first PR</a> to an organisation like OpenCV went horrible, till date, it looks like this:
<img src="https://user-images.githubusercontent.com/43996118/118848259-35d6e300-b8ec-11eb-8cdc-387e9f5a37a3.png" alt="OpenCV_PR"></p>
<p>In all honesty, I added a single commit with only a few lines of diff.</p>
<blockquote>
<p>However, I pulled all the changes from upstream <code>master</code> to my working branch, whereas the PR was to be made on <code>3.4</code> branch.</p>
</blockquote>
<p>I&rsquo;m sure I could&rsquo;ve done tons of things to solve it, but at that time I couldn&rsquo;t do anything - imagine the anxiety!</p>
<p>At this point when I look back at those fumbled PRs, I feel like they were important for my learning process.</p>
<p><strong>Fun Fact: Because of one of these initial contributions, I got a shiny little badge [<a href="https://github.com/readme/nasa-ingenuity-helicopter">Mars 2020 Helicopter Contributor</a>] on GitHub!</strong></p>
<img src="https://github.githubassets.com/images/modules/profile/badge--mars-64.png" style="width: 25%">
<h2 id="getting-started-with-matplotlib">Getting started with Matplotlib<a class="headerlink" href="#getting-started-with-matplotlib" title="Link to this heading">#</a></h2>
<p>It was around initial weeks of November last year, I was scanning through <code>Good First Issue</code> and <code>New Feature</code> labels, I realised a pattern - most <ins>Mathtext</ins> related issues were unattended.</p>
<p>To make it simple, Mathtext is a part of Matplotlib which parses mathematical expressions and provides TeX-like outputs, for example:
<span><img src="https://matplotlib.org/stable/_images/mathmpl/math-050e387807.png" style="width: 25%"></span></p>
<p>I scanned the related source code to try to figure out how to solve those Mathtext issues. Eventually, with the help of maintainers reviewing the PRs and <ins>a lot of verbose discussions</ins> on GitHub issues/pull requests and on the <a href="https://gitter.im/matplotlib/matplotlib">Gitter</a> channel, I was able to get my initial PRs merged!</p>
<h2 id="learning-throughout-the-process">Learning throughout the process<a class="headerlink" href="#learning-throughout-the-process" title="Link to this heading">#</a></h2>
<p>Most of us use libraries without understanding the underlining structure of them, which sometimes can cause downstream bugs!</p>
<p>While I was studying Matplotlib&rsquo;s architecture, I figured that I could use the same ideology for one of my <a href="https://aitikgupta.github.io/swi-ml/">own projects</a>!</p>
<p>Matplotlib uses a global dictionary-like object named as <code>rcParams</code>, I used a smaller interface, similar to rcParams, in <a href="https://pypi.org/project/swi-ml/">swi-ml</a> - a small Python library I wrote, implementing a subset of ML algorithms, with a <ins>switchable backend</ins>.</p>
<h2 id="where-does-gsoc-fit">Where does GSoC fit?<a class="headerlink" href="#where-does-gsoc-fit" title="Link to this heading">#</a></h2>
<p>It was around January, I had a conversation with one of the maintainers (hey <a href="https://github.com/anntzer">Antony</a>!) about the long-list of issues with the current ways of handling texts/fonts in the library.</p>
<p>After compiling them into an order, after few tweaks from maintainers, <a href="https://github.com/matplotlib/matplotlib/wiki/GSOC-2021-ideas">GSoC Idea-List</a> for Matplotlib was born. And so did my journey of building a strong proposal!</p>
<h2 id="about-the-project">About the Project<a class="headerlink" href="#about-the-project" title="Link to this heading">#</a></h2>
<h4 id="proposal-link-google-docs-will-stay-alive-after-gsoc-gsoc-website-not-so-sure">Proposal Link: <a href="https://docs.google.com/document/d/11PrXKjMHhl0rcQB4p_W9JY_AbPCkYuoTT0t85937nB0/edit?usp=sharing">Google Docs</a> (will stay alive after GSoC), <a href="https://storage.googleapis.com/summerofcode-prod.appspot.com/gsoc/core_project/doc/6319153410998272_1617936740_GSoC_Proposal_-_Matplotlib.pdf?Expires=1621539234&amp;GoogleAccessId=summerofcode-prod%40appspot.gserviceaccount.com&amp;Signature=QU8uSdPnXpa%2FooDtzVnzclz809LHjh9eU7Y7iR%2FH1NM32CBgzBO4%2FFbMeDmMsoic91B%2BKrPZEljzGt%2Fx9jtQeCR9X4O53JJLPVjw9Bg%2Fzb2YKjGzDk0oFMRPXjg9ct%2BV58PD6f4De1ucqARLtHGjis5jhK1W08LNiHAo88NB6BaL8Q5hqcTBgunLytTNBJh5lW2kD8eR2WeENnW9HdIe53aCdyxJkYpkgILJRoNLCvp111AJGC3RLYba9VKeU6w2CdrumPfRP45FX6fJlrKnClvxyf5VHo3uIjA3fGNWIQKwGgcd1ocGuFN3YnDTS4xkX3uiNplwTM4aGLQNhtrMqA%3D%3D">GSoC Website</a> (not so sure)<a class="headerlink" href="#proposal-link-google-docs-will-stay-alive-after-gsoc-gsoc-website-not-so-sure" title="Link to this heading">#</a></h4>
<h3 id="revisiting-textfont-handling">Revisiting Text/Font Handling<a class="headerlink" href="#revisiting-textfont-handling" title="Link to this heading">#</a></h3>
<p>The aim of the project is divided into 3 subgoals:</p>
<ol>
<li>
<p><strong>Font-Fallback</strong>: A redesigned text-first font interface - essentially parsing all family before rendering a &ldquo;tofu&rdquo;.</p>
<p><em>(similar to specifying <ins>font-family in CSS</ins>!)</em></p>
</li>
<li>
<p><strong>Font Subsetting</strong>: Every exported PS/PDF would contain embedded glyphs subsetted from the whole font.</p>
<p><em>(imagine a plot with just a single letter &ldquo;a&rdquo;, would you like it if the PDF you exported from Matplotlib to <ins>embed the whole font</ins> file within it?)</em></p>
</li>
<li>
<p>Most mpl backends would use the <ins>unified TeX exporting</ins> mechanism</p>
</li>
</ol>
<p><strong>Mentors</strong> <a href="https://github.com/tacaswell">Thomas A Caswell</a>, <a href="https://github.com/anntzer">Antony Lee</a>, <a href="https://github.com/story645">Hannah</a>.</p>
<p>Thanks a lot for spending time reading the blog! I&rsquo;ll be back with my progress in subsequent posts.</p>
<h5 id="note-this-blog-post-is-also-available-at-my-personal-website">NOTE: This blog post is also available at my <a href="https://aitikgupta.github.io/gsoc-intro/">personal website</a>!<a class="headerlink" href="#note-this-blog-post-is-also-available-at-my-personal-website" title="Link to this heading">#</a></h5>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC 2020 Work Product - Baseline Images Problem]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 3 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 1" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_2020_final_work_product/</id>
            
            
            <published>2020-08-16T09:47:51+05:30</published>
            <updated>2020-08-16T09:47:51+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Final Work Product Report for the Google Summer of Code 2020 for the Baseline Images Problem</blockquote><p>Google Summer of Code 2020 is completed. Hurray!! This post discusses about the progress so far in the three months of the coding period from 1 June to 24 August 2020 regarding the project <code>Baseline Images Problem</code> under <code>matplotlib</code> organisation under the umbrella of <code>NumFOCUS</code> organization.</p>
<h2 id="project-details">Project Details:<a class="headerlink" href="#project-details" title="Link to this heading">#</a></h2>
<p>This project helps with the difficulty in adding/modifying tests which require a baseline image. Baseline images are problematic because</p>
<ul>
<li>Baseline images cause the repo size to grow rather quickly.</li>
<li>Baseline images force matplotlib contributors to pin to a somewhat old version of FreeType because nearly every release of FreeType causes tiny rasterization changes that would entail regenerating all baseline images (and thus cause even more repo size growth).</li>
</ul>
<p>So, the idea is to not store the baseline images in the repository, instead to create them from the existing tests.</p>
<h2 id="creation-of-the-matplotlib_baseline_images-package">Creation of the matplotlib_baseline_images package<a class="headerlink" href="#creation-of-the-matplotlib_baseline_images-package" title="Link to this heading">#</a></h2>
<p>We had created the <code>matplotlib_baseline_images</code> package. This package is involved in the sub-wheels directory so that more packages can be added in the same directory, if needed in future. The <code>matplotlib_baseline_images</code> package contain baseline images for both <code>matplotlib</code> and <code>mpl_toolkits</code>.
The package can be installed by using <code>python3 -mpip install matplotlib_baseline_images</code>.</p>
<h2 id="creation-of-the-matplotlib-baseline-image-generation-flag">Creation of the matplotlib baseline image generation flag<a class="headerlink" href="#creation-of-the-matplotlib-baseline-image-generation-flag" title="Link to this heading">#</a></h2>
<p>We successfully created the <code>generate_missing</code> command line flag for baseline image generation for <code>matplotlib</code> and <code>mpl_toolkits</code> in the previous months. It was generating the <code>matplotlib</code> and the <code>mpl_toolkits</code> baseline images initially. Now, we have also modified the existing flow to generate any missing baseline images, which would be fetched from the <code>master</code> branch on doing <code>git pull</code> or <code>git checkout -b feature_branch</code>.</p>
<p>Now, the image generation on the time of fresh install of matplotlib and the generation of missing baseline images works with the <code>python3 -pytest lib/matplotlib matplotlib_baseline_image_generation</code> for the <code>lib/matplotlib</code> folder and <code>python3 -pytest lib/mpl_toolkits matplotlib_baseline_image_generation</code> for the <code>lib/mpl_toolkits</code> folder.</p>
<h2 id="documentation">Documentation<a class="headerlink" href="#documentation" title="Link to this heading">#</a></h2>
<p>We have written documentation explaining the following scenarios:</p>
<ol>
<li>How to generate the baseline images on a fresh install of matplotlib?</li>
<li>How to generate the missing baseline images on fetching changes from master?</li>
<li>How to install the <code>matplotlib_baseline_images_package</code> to be used for testing by the developer?</li>
<li>How to intentionally change an image?</li>
</ol>
<h2 id="links-to-the-work-done">Links to the work done<a class="headerlink" href="#links-to-the-work-done" title="Link to this heading">#</a></h2>
<ul>
<li><a href="https://github.com/matplotlib/matplotlib/issues/16447">Issue</a></li>
<li><a href="https://github.com/matplotlib/matplotlib/pull/17793">Pull Request</a></li>
<li><a href="/tags/gsoc/">Blog Posts</a></li>
</ul>
<h2 id="mentors">Mentors<a class="headerlink" href="#mentors" title="Link to this heading">#</a></h2>
<ul>
<li>Thomas A Caswell</li>
<li>Hannah</li>
<li>Antony Lee</li>
</ul>
<p>I am grateful to be part of such a great community. Project is really interesting and challenging :)</p>
<p>Thanks Thomas, Antony and Hannah for helping me to complete this project.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC Coding Phase 3 Blog 1]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/?utm_source=atom_feed" rel="related" type="text/html" title="Sidharth Bansal joined as GSoC&#39;20 intern" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_5/</id>
            
            
            <published>2020-08-08T09:47:51+05:30</published>
            <updated>2020-08-08T09:47:51+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Progress Report for the first half of the Google Summer of Code 2020 Phase 3 for the Baseline Images Problem</blockquote><p>Google Summer of Code 2020&rsquo;s second evaluation is completed. I passed!!! Hurray! Now we are in the mid way of the last evaluation. This post discusses about the progress so far in the first two weeks of the third coding period from 26 July to 9 August 2020.</p>
<h2 id="completion-of-the-modification-logic-for-the-matplotlib_baseline_images-package">Completion of the modification logic for the matplotlib_baseline_images package<a class="headerlink" href="#completion-of-the-modification-logic-for-the-matplotlib_baseline_images-package" title="Link to this heading">#</a></h2>
<p>We successfully created the <code>matplotlib_baseline_image_generation</code> command line flag for baseline image generation for <code>matplotlib</code> and <code>mpl_toolkits</code> in the previous months. It was generating the matplotlib and the matplotlib toolkit baseline images successfully. Now, we modified the existing flow to generate any missing baseline images, which would be fetched from the <code>master</code> branch on doing <code>git pull</code> or <code>git checkout -b feature_branch</code>.</p>
<p>We initially thought of creating a command line flag <code>generate_baseline_images_for_test &quot;test_a,test_b&quot;</code>, but later on analysis of the approach, we came to the conclusion that the developer will not know about the test names to be given along with the flag. So, we tried to generate the missing images by <code>generate_missing</code> without the test names. This worked successfully.</p>
<h2 id="adopting-reusability-and-do-not-repeat-yourself-dry-principles">Adopting reusability and Do not Repeat Yourself (DRY) Principles<a class="headerlink" href="#adopting-reusability-and-do-not-repeat-yourself-dry-principles" title="Link to this heading">#</a></h2>
<p>Later, we refactored the <code>matplot_baseline_image_generation</code> and <code>generate_missing</code> command line flags to single command line flag <code>matplotlib_baseline_image_generation</code> as the logic was similar for both of them. Now, the image generation on the time of fresh install of matplotlib and the generation of missing baseline images works with the <code>python3 -pytest lib/matplotlib matplotlib_baseline_image_generation</code> for the <code>lib/matplotlib</code> folder and <code>python3 -pytest lib/mpl_toolkits matplotlib_baseline_image_generation</code> for the <code>lib/mpl_toolkits</code> folder.</p>
<h2 id="writing-the-documentation">Writing the documentation<a class="headerlink" href="#writing-the-documentation" title="Link to this heading">#</a></h2>
<p>We have written documentation explaining the following scenarios:</p>
<ol>
<li>How to generate the baseline images on a fresh install of matplotlib?</li>
<li>How to generate the missing baseline images on fetching changes from master?</li>
<li>How to install the <code>matplotlib_baseline_images_package</code> to be used for testing by the developer?</li>
<li>How to intentionally change an image?</li>
</ol>
<h2 id="refactoring-and-improving-the-code-quality-before-merging">Refactoring and improving the code quality before merging<a class="headerlink" href="#refactoring-and-improving-the-code-quality-before-merging" title="Link to this heading">#</a></h2>
<p>Right now, we are trying to refactor the code and maintain git clean history. The <a href="https://github.com/matplotlib/matplotlib/pull/17793">current PR</a> is under review. I am working on the suggested changes. We are trying to merge this :)</p>
<h2 id="daily-meet-ups">Daily Meet-ups<a class="headerlink" href="#daily-meet-ups" title="Link to this heading">#</a></h2>
<p>Monday to Thursday meeting initiated at <a href="https://everytimezone.com/">11:00pm IST</a> via Zoom. Meeting notes are present at HackMD.</p>
<p>I am grateful to be part of such a great community. Project is really interesting and challenging :) Thanks Thomas, Antony and Hannah for helping me so far.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC Coding Phase 2 Blog 2]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 2 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/?utm_source=atom_feed" rel="related" type="text/html" title="Sidharth Bansal joined as GSoC&#39;20 intern" />
                <link href="https://blog.scientific-python.org/matplotlib/matplotlib-rsef/?utm_source=atom_feed" rel="related" type="text/html" title="Elliott Sales de Andrade hired as Matplotlib Software Research Engineering Fellow" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_4/</id>
            
            
            <published>2020-07-23T19:47:51+05:30</published>
            <updated>2020-07-23T19:47:51+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Progress Report for the second half of the Google Summer of Code 2020 Phase 2 for the Baseline Images Problem</blockquote><p>Google Summer of Code 2020&rsquo;s second evaluation is about to complete. Now we are about to start with the final coding phase. This post discusses about the progress so far in the last two weeks of the second coding period from 13 July to 26 July 2020.</p>
<h2 id="modular-approach-towards-removal-of-matplotlib-baseline-images">Modular approach towards removal of matplotlib baseline images<a class="headerlink" href="#modular-approach-towards-removal-of-matplotlib-baseline-images" title="Link to this heading">#</a></h2>
<p>We have divided the work in two parts as discussed in the <a href="../gsoc_coding_phase_blog_3/">previous blog</a>. The first part is the generation of the baseline images discussed below. The second part is the modification of the baseline images. The modification part will be implemented in the last phase of the Google Summer of Code 2020.</p>
<h2 id="generation-of-the-matplotlib-baseline-images">Generation of the matplotlib baseline images<a class="headerlink" href="#generation-of-the-matplotlib-baseline-images" title="Link to this heading">#</a></h2>
<p>Now, we have started removing the use of the <code>matplotlib_baseline_images</code> package. After the changes proposed in the <a href="https://github.com/matplotlib/matplotlib/pull/17557">previous PR</a>, the developer will have no baseline images on fresh install of matplotlib. So, the developer would need to generate matplotlib baseline images locally to get started with the testing part of the mpl.
The images can be generated by the image comparison tests with use of <code>matplotlib_baseline_image_generation</code> flag from the command line. Once these images are generated for the first time, then they can be used as the baseline images for the later times for comparison. This is the main principle adopted.</p>
<h2 id="completion-of-the-generation-of-images-for-the-matplotlib-directory">Completion of the generation of images for the matplotlib directory<a class="headerlink" href="#completion-of-the-generation-of-images-for-the-matplotlib-directory" title="Link to this heading">#</a></h2>
<p>We successfully created the <code>matplotlib_baseline_image_generation</code> flag in the beginning of the second evaluation but images were not created in the <code>baseline images</code> directory inside the <code>matplotlib</code> and <code>mpl_toolkits</code> directories, instead they were created in the <code>result_images</code> directory. So, we implemented this functionality. The images are created in the <code>lib/matplotlib/tests/baseline_images</code> directory directly now in the baseline image generation step. The baseline image generation step uses <code>python3 -mpytest lib/matplotlib --matplotlib_baseline_image_generation</code> command. Later on, running the pytests with <code>python3 -mpytest lib/matplotlib</code> will start the image comparison.</p>
<p>Right now, the matplotlib_baseline_image_generation flag works for the matplotlib directory. We are trying to achieve the same functionality for the mpl_toolkits directory.</p>
<h2 id="future-goals">Future Goals<a class="headerlink" href="#future-goals" title="Link to this heading">#</a></h2>
<p>Once the generation of the baseline images for <code>mpl_toolkits</code> directory is completed in the <a href="https://github.com/matplotlib/matplotlib/pull/17793">current PR</a>, we will move to the modification of the baseline images in the third coding phase. The addition of new baseline image and deletion of the old baseline image will also be implemented in the last phase of GSoC. Modification of baseline images will be further divided into two sub tasks: addition of new baseline image and the deletion of the previous baseline image.</p>
<h2 id="daily-meet-ups">Daily Meet-ups<a class="headerlink" href="#daily-meet-ups" title="Link to this heading">#</a></h2>
<p>Monday to Thursday meeting initiated at <a href="https://everytimezone.com/">11:00pm IST</a> via Zoom. Meeting notes are present at HackMD.</p>
<p>I am grateful to be part of such a great community. Project is really interesting and challenging :) Thanks Thomas, Antony and Hannah for helping me so far.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC Coding Phase 2 Blog 1]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 2" />
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/?utm_source=atom_feed" rel="related" type="text/html" title="Sidharth Bansal joined as GSoC&#39;20 intern" />
                <link href="https://blog.scientific-python.org/matplotlib/matplotlib-rsef/?utm_source=atom_feed" rel="related" type="text/html" title="Elliott Sales de Andrade hired as Matplotlib Software Research Engineering Fellow" />
                <link href="https://blog.scientific-python.org/matplotlib/animated-fractals/?utm_source=atom_feed" rel="related" type="text/html" title="Animate Your Own Fractals in Python with Matplotlib" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_3/</id>
            
            
            <published>2020-07-11T19:47:51+05:30</published>
            <updated>2020-07-11T19:47:51+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Progress Report for the first half of the Google Summer of Code 2020 Phase 2 for the Baseline Images Problem</blockquote><p>Google Summer of Code 2020&rsquo;s first evaluation is completed. I passed!!! Hurray! Now we are in the mid way of the second evaluation. This post discusses about the progress so far in the first two weeks of the second coding period from 30 June to 12 July 2020.</p>
<h2 id="completion-of-the-matplotlib_baseline_images-package">Completion of the matplotlib_baseline_images package<a class="headerlink" href="#completion-of-the-matplotlib_baseline_images-package" title="Link to this heading">#</a></h2>
<p>We successfully created the matplotlib_baseline_images package. It contains the matplotlib and the matplotlib toolkit baseline images. Symlinking is done for the baseline images, related changes for Travis, appvoyer, azure pipelines etc. are functional and tests/test_data is created as discussed in the previous blog. PR is reviewed and suggested work is done.</p>
<h2 id="modular-approach-towards-removal-of-matplotlib-baseline-images">Modular approach towards removal of matplotlib baseline images<a class="headerlink" href="#modular-approach-towards-removal-of-matplotlib-baseline-images" title="Link to this heading">#</a></h2>
<p>We have divide the work in two parts. The first part is the generation of the baseline images discussed below. The second part is the modification of the baseline images which happens when some baseline images gets modified due to <code>git push</code> or <code>git merge</code>. Modification of baseline images will be further divided into two sub tasks: addition of new baseline image and the deletion of the previous baseline image. This will be discussed in the second half of the second phase of the Google Summer of Code 2020.</p>
<h2 id="generation-of-the-matplotlib-baseline-images">Generation of the matplotlib baseline images<a class="headerlink" href="#generation-of-the-matplotlib-baseline-images" title="Link to this heading">#</a></h2>
<p>After the changes proposed in the <a href="https://github.com/matplotlib/matplotlib/pull/17557">previous PR</a>, the developer will have no baseline images on fresh install of matplotlib. The developer would need to install the sub-wheel matplotlib_baseline_images package to get started with the testing part of the mpl. Now, we have started removing the use of the matplotlib_baseline_images package. It will require two steps as discussed above.
The images can be generated by the image comparison tests. Once these images are generated for the first time, then they can be used as the baseline images for the later times for comparison. This is the main principle adopted. The images are first created in the <code>result_images</code> directory. Then they will be moved to the <code>lib/matplotlib/tests/baseline_images</code> directory. Later on, running the pytests will start the image comparison.</p>
<h2 id="created-commandline-flags-for-baseline-images-creation">Created commandline flags for baseline images creation<a class="headerlink" href="#created-commandline-flags-for-baseline-images-creation" title="Link to this heading">#</a></h2>
<p>I learned about the pytest hooks and fixtures. I build a command line flag <code>matplotlib_baseline_image_generation</code> which will create the baseline images in the <code>result_images</code> directory. The full command will be <code>python3 pytest --matplotlib_baseline_image_generation</code>. In order to do this, we have done changes in the <code>conftest.py</code> and also added markers to the <code>image_comparison</code> decorator.</p>
<h2 id="learning-more-about-the-git-and-virtual-environments">Learning more about the Git and virtual environments<a class="headerlink" href="#learning-more-about-the-git-and-virtual-environments" title="Link to this heading">#</a></h2>
<p>I came to know about the git worktree and the scenarios in which we can use it. I also know more about virtual environments and their need in different scenarios.</p>
<h2 id="future-goals">Future Goals<a class="headerlink" href="#future-goals" title="Link to this heading">#</a></h2>
<p>Once the generation of the baseline images is completed in the <a href="https://github.com/matplotlib/matplotlib/pull/17793">current PR</a>, we will move to the modification of the baseline images in the second half of the second coding phase.</p>
<h2 id="daily-meet-ups">Daily Meet-ups<a class="headerlink" href="#daily-meet-ups" title="Link to this heading">#</a></h2>
<p>Monday to Thursday meeting initiated at <a href="https://everytimezone.com/">11:00pm IST</a> via Zoom. Meeting notes are present at HackMD.</p>
<p>I am grateful to be part of such a great community. Project is really interesting and challenging :) Thanks Thomas, Antony and Hannah for helping me so far.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC Coding Phase 1 Blog 2]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/?utm_source=atom_feed" rel="related" type="text/html" title="GSoC Coding Phase 1 Blog 1" />
                <link href="https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/?utm_source=atom_feed" rel="related" type="text/html" title="Sidharth Bansal joined as GSoC&#39;20 intern" />
                <link href="https://blog.scientific-python.org/matplotlib/matplotlib-rsef/?utm_source=atom_feed" rel="related" type="text/html" title="Elliott Sales de Andrade hired as Matplotlib Software Research Engineering Fellow" />
                <link href="https://blog.scientific-python.org/matplotlib/animated-polar-plot/?utm_source=atom_feed" rel="related" type="text/html" title="Animated polar plot with oceanographic data" />
                <link href="https://blog.scientific-python.org/matplotlib/pyplot-vs-object-oriented-interface/?utm_source=atom_feed" rel="related" type="text/html" title="Pyplot vs Object Oriented Interface" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_2/</id>
            
            
            <published>2020-06-24T16:47:51+05:30</published>
            <updated>2020-06-24T16:47:51+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Progress Report for the second half of the Google Summer of Code 2020 Phase 1 for the Baseline Images Problem</blockquote><p>Google Summer of Code 2020&rsquo;s first evaluation is about to complete. This post discusses about the progress so far in the last two weeks of the first coding period from 15 June to 30 June 2020.</p>
<h2 id="completion-of-the-demo-package">Completion of the demo package<a class="headerlink" href="#completion-of-the-demo-package" title="Link to this heading">#</a></h2>
<p>We successfully created the demo app and uploaded it to the test.pypi. It contains the main and the secondary package. The main package is analogous to the matplotlib and secondary package is analogous to the matplotlib_baseline_images package as discussed in the previous blog.</p>
<h2 id="learning-more-about-the-git-and-mpl-workflow">Learning more about the Git and mpl workflow<a class="headerlink" href="#learning-more-about-the-git-and-mpl-workflow" title="Link to this heading">#</a></h2>
<p>I came across another way to merge the master into the branch to resolve conflicts is by rebasing the master. I understood how to create modular commits inside a pull request for easy reviewal process and better understandability of the code.</p>
<h2 id="creation-of-the-matplotlib_baseline_images-package">Creation of the matplotlib_baseline_images package<a class="headerlink" href="#creation-of-the-matplotlib_baseline_images-package" title="Link to this heading">#</a></h2>
<p>Then, we implemented the similar changes to create the <code>matplotlib_baseline_images</code> package. Finally, we were successful in uploading it to the <a href="https://test.pypi.org/project/matplotlib.baseline-images/3.3.0rc1/#history">test.pypi</a>. This package is involved in the <code>sub-wheels</code> directory so that more packages can be added in the same directory, if needed in future. The <code>matplotlib_baseline_images</code> package contain baseline images for both <code>matplotlib</code> and <code>mpl_toolkits</code>.
Some changes were required in the main <code>matplotlib</code> package&rsquo;s setup.py so that it will not take information from the packages present in the <code>sub-wheels</code> directory.</p>
<h2 id="symlinking-the-baseline-images">Symlinking the baseline images<a class="headerlink" href="#symlinking-the-baseline-images" title="Link to this heading">#</a></h2>
<p>As baseline images are moved out of the <code>lib/matplotlib</code> and <code>lib/mpl_toolkits</code> directory. We symlinked the locations where they are used, namely in <code>lib/matplotlib/testing/decorator.py</code>, <code>tools/triage_tests.py</code>, <code>lib/matplotlib/tests/__init__.py</code> and <code>lib/mpl_toolkits/tests/__init__.py</code>.</p>
<h2 id="creation-of-the-teststest_data-directory">Creation of the tests/test_data directory<a class="headerlink" href="#creation-of-the-teststest_data-directory" title="Link to this heading">#</a></h2>
<p>There are some test data that is present in the <code>baseline_images</code> which doesn&rsquo;t need to be moved to the <code>matplotlib_baseline_images</code> package. So, that is stored under the <code>lib/matplotlib/tests/test_data</code> folder.</p>
<h2 id="understanding-travis-appvoyer-and-azure-pipelines">Understanding Travis, Appvoyer and Azure-pipelines<a class="headerlink" href="#understanding-travis-appvoyer-and-azure-pipelines" title="Link to this heading">#</a></h2>
<p>I came across the Continuous Integration tools used at mpl. We tried to install the <code>matplotlib</code> followed by <code>matplotlib_baseline_images</code> package in all three travis, appvoyer and azure-pipeline.</p>
<h2 id="future-goals">Future Goals<a class="headerlink" href="#future-goals" title="Link to this heading">#</a></h2>
<p>Once the <a href="https://github.com/matplotlib/matplotlib/pull/17557">current PR</a> is merged, we will move to the <a href="https://github.com/matplotlib/matplotlib/issues/16447">Proposal for the baseline images problem</a>.</p>
<h2 id="daily-meet-ups">Daily Meet-ups<a class="headerlink" href="#daily-meet-ups" title="Link to this heading">#</a></h2>
<p>Everyday meeting initiated at <a href="https://everytimezone.com/">11:00pm IST</a> via Zoom. Meeting notes are present at HackMD.</p>
<p>I am grateful to be part of such a great community. Project is really interesting and challenging :) Thanks Antony and Hannah for helping me so far.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[GSoC Coding Phase 1 Blog 1]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/?utm_source=atom_feed" rel="related" type="text/html" title="Sidharth Bansal joined as GSoC&#39;20 intern" />
                <link href="https://blog.scientific-python.org/matplotlib/matplotlib-rsef/?utm_source=atom_feed" rel="related" type="text/html" title="Elliott Sales de Andrade hired as Matplotlib Software Research Engineering Fellow" />
                <link href="https://blog.scientific-python.org/matplotlib/pyplot-vs-object-oriented-interface/?utm_source=atom_feed" rel="related" type="text/html" title="Pyplot vs Object Oriented Interface" />
                <link href="https://blog.scientific-python.org/matplotlib/emoji-mosaic-art/?utm_source=atom_feed" rel="related" type="text/html" title="Emoji Mosaic Art" />
                <link href="https://blog.scientific-python.org/matplotlib/draw-all-graphs-of-n-nodes/?utm_source=atom_feed" rel="related" type="text/html" title="Draw all graphs of N nodes" />
            
                <id>https://blog.scientific-python.org/matplotlib/gsoc_coding_phase_blog_1/</id>
            
            
            <published>2020-06-09T16:47:51+05:30</published>
            <updated>2020-06-09T16:47:51+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Progress Report for the first half of the Google Summer of Code 2020 Phase 1 for the Baseline Images Problem</blockquote><p>I Sidharth Bansal, was waiting for the coding period to start from the March end so that I can make my hands dirty with the code. Finally, coding period has started. Two weeks have passed. This blog contains information about the progress so far from 1 June to 14 June 2020.</p>
<h2 id="movement-from-mpl-test-and-mpl-packages-to-mpl-and-mpl-baseline-images-packages">Movement from mpl-test and mpl packages to mpl and mpl-baseline-images packages<a class="headerlink" href="#movement-from-mpl-test-and-mpl-packages-to-mpl-and-mpl-baseline-images-packages" title="Link to this heading">#</a></h2>
<p>Initially, we thought of creating a <a href="https://github.com/matplotlib/matplotlib/pull/17434">mpl-test and mpl package</a>. Mpl-test package would contain the test suite and baseline images while the other package would contain parts of repository other than test and baseline-images related files and folders.
We changed our decision to creation of <a href="https://github.com/matplotlib/matplotlib/pull/17557">mpl and mpl-baseline-images packages</a> as we don&rsquo;t need to create separate package for entire test suite. Our main aim was to eliminate baseline_images from the repository. Mpl-baseline-images package will contain the data[/baseline images] and related information. The other package will contain files and folders other than baseline images.
We are now trying to create the following structure for the repository:</p>

<div class="highlight">
  <pre>mpl/
  setup.py
  lib/mpl/...
  lib/mpl/tests/...  [contains the tests .py files]
  baseline_images/
    setup.py
    data/...  [contains the image files]</pre>
</div>

<p>It will involve:</p>
<ul>
<li>Symlinking baseline images out.</li>
<li>Creating a wheel/sdist with just the baseline images; uploading it to testpypi (so that one can do <code>pip install mpl-baseline-images</code>).</li>
</ul>
<h2 id="following-prototype-modelling">Following prototype modelling<a class="headerlink" href="#following-prototype-modelling" title="Link to this heading">#</a></h2>
<p>I am creating a prototype first with two packages - main package and sub-wheel package. Once the demo app works well on <a href="https://test.pypi.org/">Test PyPi</a>, we can do similar changes to the main mpl repository.
The structure of demo app is analogous to the work needed for separation of baseline-images to a new package mpl-baseline-images as given below:</p>

<div class="highlight">
  <pre>testrepo/
  setup.py
  lib/testpkg/__init__.py
  baseline_images/setup.py
  baseline_images/testdata.txt</pre>
</div>

<p>This will also include related MANIFEST files and setup.cfg.template files. The setup.py will also contain logic for exclusion of baseline-images folder from the main mpl-package.</p>
<h2 id="following-enhancements-over-iterations">Following Enhancements over iterations<a class="headerlink" href="#following-enhancements-over-iterations" title="Link to this heading">#</a></h2>
<p>After the <a href="https://github.com/matplotlib/matplotlib/pull/17557">current PR</a> is merged, we will focus on eliminating the baseline-images from the mpl-baseline-images package. Then we will do similar changes for the Travis CI.</p>
<h2 id="bi-weekly-meet-ups-scheduled">Bi weekly meet-ups scheduled<a class="headerlink" href="#bi-weekly-meet-ups-scheduled" title="Link to this heading">#</a></h2>
<p>Every Tuesday and every Friday meeting is initiated at <a href="https://everytimezone.com/">8:30pm IST</a> via <a href="https://zoom.us/j/95996536871">Zoom</a>. Meeting notes are present at <a href="https://hackmd.io/pY25bSkCSRymk_7nX68xtw">HackMD</a>.</p>
<p>I am grateful to be part of such a great community. Project is really interesting and challenging :) Thanks Antony and Hannah for helping me so far.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Sidharth Bansal joined as GSoC'20 intern]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/matplotlib-rsef/?utm_source=atom_feed" rel="related" type="text/html" title="Elliott Sales de Andrade hired as Matplotlib Software Research Engineering Fellow" />
                <link href="https://blog.scientific-python.org/matplotlib/matplotlib-cyberpunk-style/?utm_source=atom_feed" rel="related" type="text/html" title="Matplotlib Cyberpunk Style" />
                <link href="https://blog.scientific-python.org/matplotlib/mpl-for-making-diagrams/?utm_source=atom_feed" rel="related" type="text/html" title="Matplotlib for Making Diagrams" />
                <link href="https://blog.scientific-python.org/matplotlib/create-ridgeplots-in-matplotlib/?utm_source=atom_feed" rel="related" type="text/html" title="Create Ridgeplots in Matplotlib" />
                <link href="https://blog.scientific-python.org/matplotlib/create-a-tesla-cybertruck-that-drives/?utm_source=atom_feed" rel="related" type="text/html" title="Create a Tesla Cybertruck That Drives" />
            
                <id>https://blog.scientific-python.org/matplotlib/introductory-gsoc2020-post/</id>
            
            
            <published>2020-05-06T21:47:36+05:30</published>
            <updated>2020-05-06T21:47:36+05:30</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Introductory post about Sidharth Bansal, Google Summer of Code 2020 Intern for Baseline Image Problem Project under Numfocus</blockquote><p>When I, Sidharth Bansal, heard I got selected in Google Summer of Code(GSOC) 2020 with Matplotlib under Numfocus, I was jumping and dancing. In this post, I talk about my past experiences, how I got selected for GSOC with Matplotlib, and my project details.
I am grateful to the community :)</p>
<h2 id="about-me">About me:<a class="headerlink" href="#about-me" title="Link to this heading">#</a></h2>
<p>I am currently pursuing a Bachelor’s in Technology in Software Engineering at Delhi Technological University, Delhi, India. I started my journey of open source with Public Lab, an open-source organization as a full-stack Ruby on Rails web developer. I initially did the Google Summer of Code there. I built a Multi-Party Authentication System which involves authentication of the user through multiple websites linked like mapknitter.org and spectralworkbench.org with OmniAuth providers like Facebook, twitter, google, and Github. I also worked on a Multi-Tag Subscription project there. It involved tag/category subscription by the user so that users will be notified of subsequent posts in the category they subscribe to earlier. I have also mentored there as for Google Code-In and GSoC last year. I also worked there as a freelancer.</p>
<p>Apart from this, I also successfully completed an internship in the Google Payments team at Google, India this year as a Software Engineering Intern. I built a PAN Collection Flow there. PAN(Taxation Number) information is collected from the user if the total amount claimed by the user through Scratch cards in the current financial year exceeds PAN_LIMIT. Triggered PAN UI at the time of scratching the reward. Enabled Paisa-Offers to uplift their limit to grant Scratch Cards after crossing PAN_LIMIT. Used different technologies like Java, Guice, Android, Spanner Queues, Protocol Buffers, JUnit, etc.</p>
<p>I also have a keen interest in Machine Learning and Natural Language Processing and have done a couple of projects at my university. I have researched on <code>Query Expansion using fuzzy logic</code>. I will be publishing it in some time. It involves the fuzzification of the traditional wordnet for query expansion.</p>
<p>Our paper <code>Experimental Comparison &amp; Scientometric Inspection of Research for Word Embeddings</code> got accepted in ESCI Journal and Springer LNN past week. It explains the ongoing trends in universal embeddings and compares them.</p>
<h2 id="getting-started-with-matplotlib">Getting started with matplotlib<a class="headerlink" href="#getting-started-with-matplotlib" title="Link to this heading">#</a></h2>
<p>I chose matplotlib as it is an organization with so much cool stuff relating to plotting. I have always wanted to work on such things. People are really friendly, always eager to help!</p>
<h2 id="taking-baby-steps">Taking Baby steps:<a class="headerlink" href="#taking-baby-steps" title="Link to this heading">#</a></h2>
<p>The first step is getting involved with the community. I started using the Gitter channel to know about the maintainers. I started learning the different pieces which tie up for the baseline image problem. I started with learning the system architecture of matplotlib. Then I installed the matplotlib, learned the cool tech stack related to matplotlib like sphinx, python, pypi etc.</p>
<h2 id="keep-on-contributing-and-keep-on-learning">Keep on contributing and keep on learning:<a class="headerlink" href="#keep-on-contributing-and-keep-on-learning" title="Link to this heading">#</a></h2>
<p>Learning is a continuous task. Taking guidance from mentors about the various use case scenarios involved in the GSoC project helped me to gain a lot of insights. I solved a couple of small issues. I learned about the code-review process followed here, sphinx documentation, how releases work. I did <a href="https://github.com/matplotlib/matplotlib/pulls?q=is%3Apr&#43;author%3ASidharthBansal&#43;is%3Aclosed">some PRs</a>. It was a great learning experience.</p>
<h2 id="about-the-project">About the Project:<a class="headerlink" href="#about-the-project" title="Link to this heading">#</a></h2>
<p><a href="https://github.com/matplotlib/matplotlib/issues/16447">The project</a> is about the generation of baseline images instead of downloading them. The baseline images are problematic because they cause the repo size to grow rather quickly by adding more baseline images. Also, the baseline images force matplotlib contributors to pin to a somewhat old version of FreeType because nearly every release of FreeType causes tiny rasterization changes that would entail regenerating all baseline images. Thus, it causes even more repository size growth.
The idea is not to store the baseline images at all in the Github repo. It involves dividing the matplotlib package into two separate packages - mpl-test and mpl-notest. Mpl-test will have test suite and related information. The functionality of mpl plotting library will be present in mpl-notest. We will then create the logic for generating and grabbing the latest release. Some caching will be done too. We will then implement an analogous strategy to the CI.</p>
<p><strong>Mentor</strong> <a href="https://github.com/anntzer">Antony Lee</a></p>
<p>Thanks a lot for reading….having a great time coding with great people at Matplotlib. I will be right back with my work progress in subsequent posts.</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="gsoc" label="GSoC" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
        
        <entry>
            <title type="html"><![CDATA[Elliott Sales de Andrade hired as Matplotlib Software Research Engineering Fellow]]></title>
            <link href="https://blog.scientific-python.org/matplotlib/matplotlib-rsef/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/matplotlib/mpl-for-making-diagrams/?utm_source=atom_feed" rel="related" type="text/html" title="Matplotlib for Making Diagrams" />
                <link href="https://blog.scientific-python.org/matplotlib/create-ridgeplots-in-matplotlib/?utm_source=atom_feed" rel="related" type="text/html" title="Create Ridgeplots in Matplotlib" />
                <link href="https://blog.scientific-python.org/matplotlib/create-a-tesla-cybertruck-that-drives/?utm_source=atom_feed" rel="related" type="text/html" title="Create a Tesla Cybertruck That Drives" />
                <link href="https://blog.scientific-python.org/matplotlib/an-inquiry-into-matplotlib-figures/?utm_source=atom_feed" rel="related" type="text/html" title="An Inquiry Into Matplotlib&#39;s Figures" />
                <link href="https://blog.scientific-python.org/matplotlib/custom-3d-engine/?utm_source=atom_feed" rel="related" type="text/html" title="Custom 3D engine in Matplotlib" />
            
                <id>https://blog.scientific-python.org/matplotlib/matplotlib-rsef/</id>
            
            
            <published>2020-03-20T15:51:00-04:00</published>
            <updated>2020-03-20T15:51:00-04:00</updated>
            
            
            <content type="html"><![CDATA[<blockquote>We have hired Elliott Sales de Andrade as the Matplotlib Software Research Engineering Fellow supported by the Chan Zuckerberg Initiative Essential Open Source Software for Science</blockquote><p>As has been discussed in detail in Nadia Eghbal&rsquo;s <a href="https://www.fordfoundation.org/work/learning/research-reports/roads-and-bridges-the-unseen-labor-behind-our-digital-infrastructure/">Roads and Bridges</a>, the CZI EOSS <a href="https://chanzuckerberg.com/rfa/essential-open-source-software-for-science/">program
announcement</a>, and in the NumFocus <a href="https://numfocus.org/programs/sustainability">sustainability program goals</a>, much of the critical software that science and industry are built on
is maintained by a primarily volunteer community. While this has worked, it is not sustainable in the long term for the health of many
projects or their contributors.</p>
<p>We are happy to announce that we have hired Elliott Sales de Andrade (<a href="https://github.com/QuLogic">QuLogic</a>)
as the <a href="https://github.com/matplotlib/CZI_2019-07_mpl">Matplotlib Software Research Engineering
Fellow</a> supported by
the <a href="https://chanzuckerberg.com/eoss/proposals/matplotlib-foundation-of-scientific-visualization-in-python/">Chan Zuckerberg Initiative Essential Open Source Software for
Science</a>
effective March 1, 2020!</p>
<p>Elliott has been contributing to a broad variety of Free and Open
Source projects for several years. He is an active Matplotlib
contributor and has had commit rights since October 2015. In addition
to working on Matplotlib, Elliott has contributed to a wide range of
projects in the Scientific Python software stack, both downstream and
upstream of Matplotlib, including
<a href="https://scitools.org.uk/cartopy/">Cartopy</a>,
<a href="https://obspy.org/">ObsPy</a>, and <a href="https://numpy.org/">NumPy</a>. Outside
of Python, Elliott is a developer on the <a href="https://pidgin.im/">Pidgin
project</a> and a packager for <a href="https://getfedora.org/">Fedora
Linux</a>. In his work on Matplotlib, he is interested in advancing
science through reproducible workflows and more accessible libraries.</p>
<p>We are already seeing a reduction in the backlog of open issues and
pull requests, which we hope will make the library easier to
contribute to and maintain long term. We also benefit from Elliott
having the bandwidth to maintain a library wide view of all the
on-going work and open bugs. Hiring Elliott as an RSEF is the
start of ensuring that Matplotlib is sustainable in the long term.</p>
<p>Looking forward to all the good work we are going to do this year!</p>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="news" label="News" />
                             
                                <category scheme="taxonomy:Tags" term="matplotlib" label="matplotlib" />
                            
                        
                    
                
            
        </entry>
    
</feed>
