Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package for Matplotlib 1.4 #1133

Open
wants to merge 13 commits into
base: v2.2
Choose a base branch
from
Open

Conversation

rexissimus
Copy link
Member

Adds updated package for matplotlib 1.4+

  • New parser that supports numpy docstrings
  • New codepath is matplotlib14. Old package has unchanged codepath (So it will still be used when importing to other packages).
  • Old and new package will be loaded on matplotlib <v1.4 and >=v1.4, respectively.
  • New matplotlib package version is 1.1.0
  • Upgrading from old package should in most cases work automatically.
  • Downgrading is not supported.
  • Currently you have to load the correct package version manually if the wrong one is tried first. Maybe we should try to load all codepaths for a package until one succeeds?

@dakoop
Copy link
Member

dakoop commented Oct 14, 2015

Might work to see version number in the list if there are two packages with the same name. For example

  • matplotlib (1.3)
  • matplotlib (1.4)

@tacaswell
Copy link
Contributor

As a heads up, mpl 1.5 will be coming out in the next week or so as well.

rexissimus added a commit that referenced this pull request Oct 16, 2015
core/packagemanager.py:
- identifier_is_available:
    This method maps identifiers to codepaths, and returns
    the first match. This has been updated to return valid
    packages first (That passes package_requirements()),
    or the latest version if all versions are valid or invalid.

This is used by matplotlib that use different packages for
different versions of matplotlib. (#1133)
@rexissimus
Copy link
Member Author

The package works on the matplotlib 1.5 RC, but the parser needs to be updated. I fixed a bug where signatures in the documentation were not detected correctly. This is needed because a lot of autogenerated signature arguments now have None as their default value (like psd).

@remram44
Copy link
Member

I added sorting for the ModuleSpecs. That doesn't seem to be enough, attributes are still not ordered, and in fact I get more than ordering differences when I generate twice in a row on my machine...

The diff between two consecutive runs of update.py (with matplotlib 1.5.0rc2+57.ga83dead) contains:

--- a/vistrails/packages/matplotlib14/artists.py
+++ b/vistrails/packages/matplotlib14/artists.py
@@ -3757,2 +3757,2 @@ class MplTickProperties(MplArtistProperties):
-              ("labelcolor", "basic:String",
-                {'optional': True}),
+              ("label", "basic:String",
+                {'optional': True, 'docstring': 'Set the text of ticklabel'}),
@@ -3855,2 +3855,2 @@ class MplTickProperties(MplArtistProperties):
-        if self.has_input('labelcolor'):
-            artist.constructor_props['labelcolor'] = self.get_input('labelcolor')
+        if self.has_input('label'):
+            artist.props['label'] = self.get_input('label')
--- a/vistrails/packages/matplotlib14/mpl_artists.xml
+++ b/vistrails/packages/matplotlib14/mpl_artists.xml
@@ -1854,1 +1854,3 @@ None, to remove the clipping path
-    <inputPortSpec arg="labelcolor" arg_pos="9" constructor_arg="True" name="labelcolor" />
+    <inputPortSpec arg="label" name="label">
+      <docstring>Set the text of ticklabel</docstring>
+    </inputPortSpec>
--- a/vistrails/packages/matplotlib14/mpl_artists_diff.xml
+++ b/vistrails/packages/matplotlib14/mpl_artists_diff.xml
@@ -15,1 +15,1 @@
-  <deletePortSpec code_ref="matplotlib.axis.Tick" port="clip_path" type="input" />
+  <deletePortSpec code_ref="matplotlib.axis.Tick" port="label" type="input" />

@rexissimus
Copy link
Member Author

The module sorting needs to preserve the subclass hierarchy when generating the classes. This probably makes sense to keep in the xml spec as well, so I added this.

The diff you are seeing looks wrong. It looks like the diff code is sensitive to the order of ports, but I need to look more into that...

@rexissimus
Copy link
Member Author

The faulty diff is fixed by bc096e4. An indexing bug caused the wrong spec to get deleted. I am surprised this bug has not been detected before. The new code must cause more deletions or index rearrangements.

The wrong spec was deleted when deleting multiple specs in
increasing index order due to index not being updated.

Fixed by using "x.remove(obj)" in place of "del x[i]".

Conflicts:
	vistrails/packages/matplotlib14/diff.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants