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

Bugfix for issue 4781 #4782

Merged
merged 1 commit into from May 11, 2016
Merged

Bugfix for issue 4781 #4782

merged 1 commit into from May 11, 2016

Conversation

al-niessner
Copy link
Contributor

Minor change to correct programmed failure. The first if statement checks to see if config is None and then sets it to an empty dictionary. The second conditional statement then references a non-existent key because it is an empty dictionary. Simply changed from two if statements to an ifel statement insuring that config should not be empty.

if config is None:
config = {}
if config['version_1_3_or_later'] and value == '':
if config is None: config = {}
Copy link
Member

Choose a reason for hiding this comment

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

This change (putting the if statement on one line) is not needed - can you revert this back to 2 lines?

@astrofrog
Copy link
Member

Before we can review this properly, please provide an example of a VO table that is causing these issues. We first need to be sure that this is not due to non-standard-compliant tables (which there are many of)

@astrofrog
Copy link
Member

Ok, I think I see why the if statement was incorrectly written before, but it would still be good to have an example file - since we should ideally include a regression test.

@al-niessner
Copy link
Contributor Author

Example votable attached. No, it is inline because attaching does not support XML...

<?xml version="1.0" encoding="UTF-8"?>
<VOTABLE xmlns="http://www.ivoa.net/xml/VOTable/v1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
  <RESOURCE type="results">
    <TABLE>
      <FIELD name="ID" datatype="char" ucd="meta.id;meta.main" arraysize="*" />
      <FIELD name="access_url" datatype="char" ucd="meta.ref.url" arraysize="*" />
      <FIELD name="service_def" datatype="char" ucd="meta.ref" arraysize="*" />
      <FIELD name="error_message" datatype="char" ucd="meta.code.error" arraysize="*" />
      <FIELD name="semantics" datatype="char" ucd="meta.code" arraysize="*" />
      <FIELD name="description" datatype="char" ucd="meta.note" arraysize="*" />
      <FIELD name="content_type" datatype="char" ucd="meta.code.mime" arraysize="*" />
      <FIELD name="content_length" datatype="long" ucd="phys.size;meta.file" unit="byte" />
      <FIELD name="product_type" datatype="char" utype="caom:Artifact.productType" arraysize="*" />
      <FIELD name="file_uri" datatype="char" ID="fileURIRef" arraysize="*" />
      <DATA>
        <TABLEDATA>
          <TR>
            <TD>caom:GEMINI/GS-2012A-Q-5-116-003/GS-2012A-Q-5-116-003</TD>
            <TD>http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/data/pub/GEMINI/S20120515S0064?runid=bx9b1o8cvk1qesrt</TD>
            <TD />
            <TD />
            <TD>#this</TD>
            <TD />
            <TD>application/fits</TD>
            <TD>7068398</TD>
            <TD>science</TD>
            <TD />
          </TR>
          <TR>
            <TD>caom:GEMINI/GS-2012A-Q-5-116-003/GS-2012A-Q-5-116-003</TD>
            <TD />
            <TD>cutout</TD>
            <TD />
            <TD>#cutout</TD>
            <TD />
            <TD>application/fits</TD>
            <TD />
            <TD>science</TD>
            <TD>ad:GEMINI/S20120515S0064</TD>
          </TR>
          <TR>
            <TD>caom:GEMINI/GS-2012A-Q-5-116-003/GS-2012A-Q-5-116-003</TD>
            <TD />
            <TD>soda-62b3e0b3-2718-442f-920a-ce8028687c2b</TD>
            <TD />
            <TD>#cutout</TD>
            <TD />
            <TD>application/fits</TD>
            <TD />
            <TD>science</TD>
            <TD>ad:GEMINI/S20120515S0064</TD>
          </TR>
          <TR>
            <TD>caom:GEMINI/GS-2012A-Q-5-116-003/GS-2012A-Q-5-116-003</TD>
            <TD />
            <TD>soda-d0378127-e438-46a2-880f-42df8884a2ff</TD>
            <TD />
            <TD>#cutout</TD>
            <TD />
            <TD>application/fits</TD>
            <TD />
            <TD>science</TD>
            <TD>ad:GEMINI/S20120515S0064</TD>
          </TR>
        </TABLEDATA>
      </DATA>
    </TABLE>
    <INFO name="QUERY_STATUS" value="OK" />
  </RESOURCE>
  <RESOURCE type="meta" ID="this" utype="adhoc:service">
    <PARAM name="resourceIdentifier" datatype="char" arraysize="*" value="ivo://cadc.nrc.ca/datalink" />
    <PARAM name="standardID" datatype="char" arraysize="*" value="ivo://ivoa.net/std/DataLink#links-1.0" />
    <PARAM name="accessURL" datatype="char" arraysize="*" value="http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/datalink" />
    <GROUP name="inputParams">
      <PARAM name="ID" datatype="char" arraysize="*" value="" />
      <PARAM name="RESPONSEFORMAT" datatype="char" arraysize="*" value="application/x-votable+xml;content=datalink">
        <VALUES>
          <OPTION value="application/x-votable+xml;content=datalink" />
          <OPTION value="application/x-download-manifest+txt" />
        </VALUES>
      </PARAM>
    </GROUP>
  </RESOURCE>
  <RESOURCE type="meta" ID="cutout" utype="adhoc:service">
    <PARAM name="resourceIdentifier" datatype="char" arraysize="*" value="ivo://cadc.nrc.ca/cutout" />
    <PARAM name="accessURL" datatype="char" arraysize="*" value="http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/cutout" />
    <GROUP name="inputParams">
      <PARAM name="uri" datatype="char" ref="fileURIRef" arraysize="*" value="" />
      <PARAM name="cutout" datatype="char" xtype="stc:AstroCoordArea" arraysize="*" value="" />
    </GROUP>
  </RESOURCE>
  <RESOURCE type="meta" ID="soda-sync" utype="adhoc:service">
    <PARAM name="resourceIdentifier" datatype="char" arraysize="*" value="ivo://cadc.nrc.ca/soda#sync" />
    <PARAM name="standardID" datatype="char" arraysize="*" value="ivo://ivoa.net/std/SODA#sync-1.0" />
    <PARAM name="accessURL" datatype="char" arraysize="*" value="http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/sync" />
    <GROUP name="inputParams">
      <PARAM name="ID" datatype="char" ref="fileURIRef" arraysize="*" value="" />
      <PARAM name="POS" datatype="char" ucd="obs.field" arraysize="*" value="" />
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="deg" xtype="circle" arraysize="3" value="" />
      <PARAM name="POLY" datatype="double" ucd="obs.field" unit="deg" xtype="polygon" arraysize="*" value="" />
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval" unit="m" xtype="interval" arraysize="2" value="" />
      <PARAM name="TIME" datatype="double" ucd="time;stat.interval" unit="d" xtype="interval" arraysize="2" value="" />
      <PARAM name="POL" datatype="char" ucd="phys.polarization.stokes" arraysize="2*" value="" />
    </GROUP>
  </RESOURCE>
  <RESOURCE type="meta" ID="soda-async" utype="adhoc:service">
    <PARAM name="resourceIdentifier" datatype="char" arraysize="*" value="ivo://cadc.nrc.ca/soda#async" />
    <PARAM name="standardID" datatype="char" arraysize="*" value="ivo://ivoa.net/std/SODA#async-1.0" />
    <PARAM name="accessURL" datatype="char" arraysize="*" value="http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/async" />
    <GROUP name="inputParams">
      <PARAM name="ID" datatype="char" ref="fileURIRef" arraysize="*" value="" />
      <PARAM name="POS" datatype="char" ucd="obs.field" arraysize="*" value="" />
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="deg" xtype="circle" arraysize="3" value="" />
      <PARAM name="POLY" datatype="double" ucd="obs.field" unit="deg" xtype="polygon" arraysize="*" value="" />
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval" unit="m" xtype="interval" arraysize="2" value="" />
      <PARAM name="TIME" datatype="double" ucd="time;stat.interval" unit="d" xtype="interval" arraysize="2" value="" />
      <PARAM name="POL" datatype="char" ucd="phys.polarization.stokes" arraysize="2*" value="" />
    </GROUP>
  </RESOURCE>
  <RESOURCE type="meta" ID="soda-62b3e0b3-2718-442f-920a-ce8028687c2b" utype="adhoc:service">
    <PARAM name="resourceIdentifier" datatype="char" arraysize="27" value="ivo://cadc.nrc.ca/soda#sync" />
    <PARAM name="standardID" datatype="char" arraysize="32" value="ivo://ivoa.net/std/SODA#sync-1.0" />
    <PARAM name="accessURL" datatype="char" arraysize="*" value="http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/sync" />
    <GROUP name="inputParams">
      <PARAM name="ID" datatype="char" ucd="" arraysize="*" value="ad:GEMINI/S20120515S0064" />
      <PARAM name="POS" datatype="char" ucd="obs.field" arraysize="*" value="" />
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="deg" xtype="circle" arraysize="3" value="">
        <VALUES>
          <MAX value="249.4461412814794 6.208882135413049 0.04682149110213382" />
        </VALUES>
      </PARAM>
      <PARAM name="POLY" datatype="double" ucd="obs.field" unit="deg" xtype="polygon" arraysize="*" value="">
        <VALUES>
          <MAX value="249.39904413680034 6.208645591686135 249.39911774129286 6.209064581212914 249.49323846809307 6.209114516657962 249.49307002200794 6.208699271984017" />
        </VALUES>
      </PARAM>
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval" unit="m" xtype="interval" arraysize="2" value="">
        <VALUES>
          <MAX value="4.1449399999999995E-7 7.416079999999999E-7" />
        </VALUES>
      </PARAM>
    </GROUP>
  </RESOURCE>
  <RESOURCE type="meta" ID="soda-d0378127-e438-46a2-880f-42df8884a2ff" utype="adhoc:service">
    <PARAM name="resourceIdentifier" datatype="char" arraysize="28" value="ivo://cadc.nrc.ca/soda#async" />
    <PARAM name="standardID" datatype="char" arraysize="33" value="ivo://ivoa.net/std/SODA#async-1.0" />
    <PARAM name="accessURL" datatype="char" arraysize="*" value="http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/async" />
    <GROUP name="inputParams">
      <PARAM name="ID" datatype="char" ucd="" arraysize="*" value="ad:GEMINI/S20120515S0064" />
      <PARAM name="POS" datatype="char" ucd="obs.field" arraysize="*" value="" />
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="deg" xtype="circle" arraysize="3" value="">
        <VALUES>
          <MAX value="249.4461412814794 6.208882135413049 0.04682149110213382" />
        </VALUES>
      </PARAM>
      <PARAM name="POLY" datatype="double" ucd="obs.field" unit="deg" xtype="polygon" arraysize="*" value="">
        <VALUES>
          <MAX value="249.39904413680034 6.208645591686135 249.39911774129286 6.209064581212914 249.49323846809307 6.209114516657962 249.49307002200794 6.208699271984017" />
        </VALUES>
      </PARAM>
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval" unit="m" xtype="interval" arraysize="2" value="">
        <VALUES>
          <MAX value="4.1449399999999995E-7 7.416079999999999E-7" />
        </VALUES>
      </PARAM>
    </GROUP>
  </RESOURCE>
</VOTABLE>

@al-niessner
Copy link
Contributor Author

Validation is an interesting question. xmllint, which I trust from number of users and history, says all is good:

$ wget -O /tmp/votable.xsd http://www.ivoa.net/xml/VOTable/v1.2
--2016-04-14 13:21:27--  http://www.ivoa.net/xml/VOTable/v1.2
Resolving www.ivoa.net (www.ivoa.net)... 202.52.53.51
Connecting to www.ivoa.net (www.ivoa.net)|202.52.53.51|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21566 (21K) [application/x-troff-man]
Saving to: ‘/tmp/votable.xsd’

100%[======================================>] 21,566      85.1KB/s   in 0.2s   

2016-04-14 13:21:28 (85.1 KB/s) - ‘/tmp/votable.xsd’ saved [21566/21566]

$ xmllint --noout --schema /tmp/votable.xsd /tmp/vot.xml 
/tmp/vot.xml validates
$

However, it seems that astropy.io.votable.validate() disagrees:

$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import astropy.io.votable
>>> astropy.io.votable.validate('/tmp/vot.xml')
Validation report for /tmp/vot.xml

37: W49: Empty cell illegal for integer fields.
            <TD />
            ^

49: W49: Empty cell illegal for integer fields.
            <TD />
            ^

61: W49: Empty cell illegal for integer fields.
            <TD />
            ^

74: W10: Unknown tag 'GROUP'.  Ignoring
    <GROUP name="inputParams">
    ^

78: W48: Unknown attribute 'value' on OPTION
          <OPTION value="application/x-votable+xml;content=datalink...
          ^

79: W48: Unknown attribute 'value' on OPTION
          <OPTION value="application/x-download-manifest+txt" />
          ^

87: W10: Unknown tag 'GROUP'.  Ignoring
    <GROUP name="inputParams">
    ^

96: W10: Unknown tag 'GROUP'.  Ignoring
    <GROUP name="inputParams">
    ^

98: W06: Invalid UCD 'obs.field': Secondary word 'obs.field' is not
  valid as a primary word
      <PARAM name="POS" datatype="char" ucd="obs.field" arraysize="...
      ^

99: W06: Invalid UCD 'obs.field': Secondary word 'obs.field' is not
  valid as a primary word
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="de...
      ^

99: E02: Incorrect number of elements in array. Expected multiple of
  3, got 1
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="de...
      ^

100: W06: Invalid UCD 'obs.field': Secondary word 'obs.field' is not
  valid as a primary word
      <PARAM name="POLY" datatype="double" ucd="obs.field" unit="de...
      ^

101: W06: Invalid UCD 'em.wl;stat.interval': Unknown word
  'stat.interval'
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval...
      ^

101: E02: Incorrect number of elements in array. Expected multiple of
  2, got 1
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval...
      ^

102: W06: Invalid UCD 'time;stat.interval': Unknown word
  'stat.interval'
      <PARAM name="TIME" datatype="double" ucd="time;stat.interval"...
      ^

102: E02: Incorrect number of elements in array. Expected multiple of
  2, got 1
      <PARAM name="TIME" datatype="double" ucd="time;stat.interval"...
      ^

110: W10: Unknown tag 'GROUP'.  Ignoring
    <GROUP name="inputParams">
    ^

112: W06: Invalid UCD 'obs.field': Secondary word 'obs.field' is not
  valid as a primary word
      <PARAM name="POS" datatype="char" ucd="obs.field" arraysize="...
      ^

113: W06: Invalid UCD 'obs.field': Secondary word 'obs.field' is not
  valid as a primary word
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="de...
      ^

113: E02: Incorrect number of elements in array. Expected multiple of
  3, got 1
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="de...
      ^

114: W06: Invalid UCD 'obs.field': Secondary word 'obs.field' is not
  valid as a primary word
      <PARAM name="POLY" datatype="double" ucd="obs.field" unit="de...
      ^

115: W06: Invalid UCD 'em.wl;stat.interval': Unknown word
  'stat.interval'
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval...
      ^

115: E02: Incorrect number of elements in array. Expected multiple of
  2, got 1
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval...
      ^

116: W06: Invalid UCD 'time;stat.interval': Unknown word
  'stat.interval' (suppressing further warnings of this type...)
      <PARAM name="TIME" datatype="double" ucd="time;stat.interval"...
      ^

116: E02: Incorrect number of elements in array. Expected multiple of
  2, got 1
      <PARAM name="TIME" datatype="double" ucd="time;stat.interval"...
      ^

124: W10: Unknown tag 'GROUP'.  Ignoring
    <GROUP name="inputParams">
    ^

127: E02: Incorrect number of elements in array. Expected multiple of
  3, got 1
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="de...
      ^

137: E02: Incorrect number of elements in array. Expected multiple of
  2, got 1
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval...
      ^

148: W10: Unknown tag 'GROUP'.  Ignoring
    <GROUP name="inputParams">
    ^

151: E02: Incorrect number of elements in array. Expected multiple of
  3, got 1
      <PARAM name="CIRC" datatype="double" ucd="obs.field" unit="de...
      ^

161: E02: Incorrect number of elements in array. Expected multiple of
  2, got 1 (suppressing further warnings of this type...)
      <PARAM name="BAND" datatype="double" ucd="em.wl;stat.interval...
      ^

False
>>> 

I think this is another problem but far beyond the scope of this bug and fix. I am simply pointing out you have to be careful when you say it validates as to which tool.

@@ -367,6 +369,8 @@ New Features

- ``astropy.vo``

- KeyError when converting Table v1.2 numeric arrays fixed. [#4781]
Copy link
Member

Choose a reason for hiding this comment

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

Remove duplicate change log entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since both releases are marked as unreleased how is one to know which is
the duplicate? Obviously I can tell by the line numbers, but I am
suggesting that having 1.2 and 1.1.3 both as unreleased makes it very
unclear as to which release is going to include the pull release. Hence
I put it in both.

On Thu, 2016-04-14 at 13:30 -0700, P. L. Lim wrote:

In CHANGES.rst:

@@ -367,6 +369,8 @@ New Features

Remove duplicate change log entry.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

Copy link
Member

Choose a reason for hiding this comment

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

That's why it's better to wait for a maintainer to milestone the PR before adding the changelog entry. Also please change the PR number, it should point to the PR (#4782) and not the issue it fixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did. Changeset bfc403c

On Thu, 2016-04-14 at 13:30 -0700, P. L. Lim wrote:

In CHANGES.rst:

@@ -367,6 +369,8 @@ New Features

Remove duplicate change log entry.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The workflow in your contribution howto says that you should edit the change file before doing the pull request. I thought that strange, but just used the issue number instead. I then linked that issue number with this pull request and vice versa. Seems the generating of issues, branches, and pull requests is still a bit murky. It would have been cleaner had I been able to (or knew how to?) tie this pull request to my issue. Oh well.

Now I am guessing my second email to remove the duplicate that I already had is really your @bsipocz request to change the PR. Funny, I am spending more time doing tedious changes than actually fixing code.

Copy link
Member

Choose a reason for hiding this comment

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

@al-niessner , it's all part of the fun of open-source project contribution. 😄

@pllim
Copy link
Member

pllim commented Apr 14, 2016

Our VO table validation applies rules from VO standards, which extend beyond basic XML schema. I agree that the elif fix looks reasonable despite this table throwing out warnings and errors.

@al-niessner
Copy link
Contributor Author

Does that really mean then that astropy.io.votable.validate() is really astropy.io.votable.verify() and that astropy.io.votable.is_votable() is equivalent to xmllint all in the context of XML? I am not suggesting name changes, I am simply trying to understand from a fixed context and I know XML while I play to votables. I appreciate that from a votable user standpoint, checking a table is called validating.

@pllim
Copy link
Member

pllim commented Apr 15, 2016

@al-niessner , validate generates a full report, like what you posted; This is same as volint command you can use from command line. is_votable simply checks the header to see if it is defined as VOTABLE.

@pllim pllim added this to the v1.1.3 milestone Apr 15, 2016
@pllim
Copy link
Member

pllim commented Apr 15, 2016

Once these are addressed, I think this will be okay to merge:

  1. Move change log entry from 1.2 to 1.1.3 since this is a bug fix.
  2. Squash all commits into one. You can use git rebase -i HEAD~n, where n is the number of your commits to squash.
  3. Add a test? I don't have a preference either way. @astrofrog, what do you think?

@al-niessner
Copy link
Contributor Author

For test, do you want doctest or something else? I would have to put
that XML into doctest so I am hoping you have something better in mind.
I have no reviewed your code well enough to know where to insert a test
effectively.

On Fri, 2016-04-15 at 08:52 -0700, P. L. Lim wrote:

Once these are addressed, I think this will be okay to merge:

 1. Move change log entry from 1.2 to 1.1.3 since this is a bug
    fix.
 2. Squash all commits into one. You can use git rebase -i HEAD~n,
    where n is the number of your commits to squash.
 3. Add a test? I don't have a preference either way. @astrofrog,
    what do you think?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@al-niessner
Copy link
Contributor Author

Should be done with the requests except the testing. I hope I got the
rebase correct because I have never done it before.

On Fri, 2016-04-15 at 08:52 -0700, P. L. Lim wrote:

Once these are addressed, I think this will be okay to merge:

 1. Move change log entry from 1.2 to 1.1.3 since this is a bug
    fix.
 2. Squash all commits into one. You can use git rebase -i HEAD~n,
    where n is the number of your commits to squash.
 3. Add a test? I don't have a preference either way. @astrofrog,
    what do you think?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@@ -367,6 +367,8 @@ New Features

- ``astropy.vo``

- KeyError when converting Table v1.2 numeric arrays fixed. [#4782]
Copy link
Member

Choose a reason for hiding this comment

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

Correct version section, but this needs to be in "bug fix" sub-section, not "new features".

@pllim
Copy link
Member

pllim commented Apr 18, 2016

For squashing commits, perhaps this tutorial will help. When it is done, you should see your changes still listed as same, but only 1 commit instead of 9 or more.

As for the test, it does not need to be a doctest. The test function would reside in astropy/io/votable/tests/converter_test.py and the data file in astropy/io/votable/tests/data. Astropy has its testing guidelines that you will need to follow.

@al-niessner
Copy link
Contributor Author

Is the astropy.test() sufficient for verifying my testing? Attached are
two files. One where I did atropy.test() and it is good. The other the
full setup.py test and it seemingly fails. Any suggestions?

There seem to be two problems really. One is that I may be have a fully
installed astropy. Fine. The other is that my addition of gemini.xml
into tests/data is being globbed by other tests and causing them heart
ache. I an change gemini.xml to another name if that helps but seems
obtuse.

I just find it disconcerting that astropy.test() is giving me the green
light while setup.py is giving me the red light.

On Mon, 2016-04-18 at 07:48 -0700, P. L. Lim wrote:

For squashing commits, perhaps (this
tutorial)[http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html] will help. When it is done, you should see your changes still listed as same, but only 1 commit instead of 9 or more.

As for the test, it does not need to be a doctest. The test function
would reside in astropy/io/votable/tests/converter_test.py and the
data file in astropy/io/votable/tests/data. Astropy has its (testing
guidelines)[http://docs.astropy.org/en/latest/development/testguide.html] that you will need to follow.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

$ PYTHONPATH=/home/niessner/Projects/astropy/build/temp.lib.linux-x86_64-3.4:$PYTHONPATH python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.

import astropy
astropy.test ('io.votable')
============================= test session starts ==============================
platform linux -- Python 3.4.3 -- pytest-2.5.1

Running tests with Astropy version 1.0.3.
Running tests in /usr/local/lib/python3.4/dist-packages/astropy/io/votable.

Platform: Linux-3.13.0-85-generic-x86_64-with-Ubuntu-14.04-trusty

Executable: /usr/bin/python3

Full Python Version:
3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.8.2
Scipy: 0.13.3
Matplotlib: 1.4.3
h5py: not available

collected 212 items

../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/converter_test.py ......................
../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/exception_test.py ..
../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/table_test.py ........
../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/tree_test.py ...
../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/ucd_test.py .....
../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/util_test.py ...........
../../usr/local/lib/python3.4/dist-packages/astropy/io/votable/tests/vo_test.py .................................................................................................................................................................

========================== 212 passed in 1.76 seconds ==========================
0

$ ASTROPY_USE_SYSTEM_PYTEST=1 python3 setup.py test
running test
running build
running build_py
running pre_hook from astropy._erfa.setup_package for build_py command
running pre_hook from astropy.modeling.setup_package for build_py command
copying astropy/io/votable/tests/converter_test.py -> build/lib.linux-x86_64-3.4/astropy/io/votable/tests
running build_ext
running pre_hook from astropy._erfa.setup_package for build_ext command
running pre_hook from astropy.modeling.setup_package for build_ext command
skipping 'astropy/table/_np_utils.c' Cython extension (up-to-date)
skipping 'astropy/table/_column_mixins.c' Cython extension (up-to-date)
skipping 'astropy/io/ascii/cparser.c' Cython extension (up-to-date)
skipping 'astropy/convolution/boundary_extend.c' Cython extension (up-to-date)
skipping 'astropy/convolution/boundary_fill.c' Cython extension (up-to-date)
skipping 'astropy/convolution/boundary_none.c' Cython extension (up-to-date)
skipping 'astropy/convolution/boundary_wrap.c' Cython extension (up-to-date)
skipping 'astropy/cosmology/scalar_inv_efuncs.c' Cython extension (up-to-date)
============================= test session starts ==============================
platform linux -- Python 3.4.3 -- pytest-2.5.1

Running tests with Astropy version 1.2.dev14912.
Running tests in /tmp/astropy-test-_4nu8t3f/lib.linux-x86_64-3.4/astropy /tmp/astropy-test-_4nu8t3f/docs.

Date: 2016-04-18T10:23:17

Platform: Linux-3.13.0-85-generic-x86_64-with-Ubuntu-14.04-trusty

Executable: /usr/bin/python3

Full Python Version:
3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.8.2
Scipy: 0.13.3
Matplotlib: 1.4.3
h5py: not available
Pandas: 0.13.1

collected 7691 items

astropy/_erfa/tests/test_erfa.py .......
astropy/analytic_functions/tests/test_blackbody.py .....
astropy/config/configuration.py .
astropy/config/tests/test_configs.py ...............
astropy/constants/init.py .
astropy/constants/tests/test_constant.py ........
astropy/constants/tests/test_pickle.py xxxxxxxxx
astropy/convolution/kernels.py ...
astropy/convolution/tests/test_convolve.py ...............................................................................................................
astropy/convolution/tests/test_convolve_fft.py ...................................................................................................................................................................................................................................................................................................................................................
astropy/convolution/tests/test_convolve_kernels.py ..............................................................................
astropy/convolution/tests/test_discretize.py ...s...........s...............
astropy/convolution/tests/test_kernel_class.py ........................................................................................................................................................................................
astropy/convolution/tests/test_pickle.py .xx.xx.xx
astropy/coordinates/angles.py ..
astropy/coordinates/baseframe.py .
astropy/coordinates/sky_coordinate.py ..
astropy/coordinates/builtin_frames/galactocentric.py .
astropy/coordinates/tests/test_angles.py ........................................
astropy/coordinates/tests/test_angular_separation.py ....
astropy/coordinates/tests/test_api_ape5.py ....s
astropy/coordinates/tests/test_arrays.py .............
astropy/coordinates/tests/test_celestial_transformations.py ............
astropy/coordinates/tests/test_distance.py .........
astropy/coordinates/tests/test_earth.py .............
astropy/coordinates/tests/test_formatting.py ..........
astropy/coordinates/tests/test_frames.py ........................
astropy/coordinates/tests/test_funcs.py ...
astropy/coordinates/tests/test_iau_fullstack.py ....................................................
astropy/coordinates/tests/test_intermediate_transformations.py ...................................................
astropy/coordinates/tests/test_matching.py ......
astropy/coordinates/tests/test_name_resolve.py sss
astropy/coordinates/tests/test_pickle.py ....xx.x...xx.x...xx.x.
astropy/coordinates/tests/test_regression.py .......
astropy/coordinates/tests/test_representation.py .............................................................................
astropy/coordinates/tests/test_sites.py .ss.s..
astropy/coordinates/tests/test_sky_coord.py ........................................................................................................................................................................................................................................................................................................................................................................................x...............s.
astropy/coordinates/tests/test_transformations.py ......
astropy/coordinates/tests/test_unit_representation.py .
astropy/coordinates/tests/accuracy/test_altaz_icrs.py ...x
astropy/coordinates/tests/accuracy/test_ecliptic.py .....
astropy/coordinates/tests/accuracy/test_fk4_no_e_fk4.py .
astropy/coordinates/tests/accuracy/test_fk4_no_e_fk5.py .
astropy/coordinates/tests/accuracy/test_galactic_fk4.py .
astropy/coordinates/tests/accuracy/test_icrs_fk5.py .
astropy/cosmology/tests/test_cosmology.py .......................................
astropy/cosmology/tests/test_pickle.py ...
astropy/io/ascii/core.py .
astropy/io/ascii/daophot.py .
astropy/io/ascii/ipac.py .
astropy/io/ascii/tests/test_c_reader.py ...........................x..................x.......x.x.................
astropy/io/ascii/tests/test_cds_header_from_readme.py ....
astropy/io/ascii/tests/test_compressed.py .......
astropy/io/ascii/tests/test_connect.py ........................
astropy/io/ascii/tests/test_ecsv.py .......
astropy/io/ascii/tests/test_fixedwidth.py ...............................
astropy/io/ascii/tests/test_html.py ........s.....s..ss
astropy/io/ascii/tests/test_ipac_definitions.py ....................
astropy/io/ascii/tests/test_read.py ...........................................................................................................
astropy/io/ascii/tests/test_types.py ...
astropy/io/ascii/tests/test_write.py ......................................
astropy/io/fits/diff.py .
astropy/io/fits/util.py ...
astropy/io/fits/tests/test_checksum.py .....................
astropy/io/fits/tests/test_connect.py ...........................
astropy/io/fits/tests/test_core.py ..................................................ss..........
astropy/io/fits/tests/test_diff.py ...................................
astropy/io/fits/tests/test_division.py .....
astropy/io/fits/tests/test_groups.py ........
astropy/io/fits/tests/test_hdulist.py .........................................
astropy/io/fits/tests/test_header.py ................................................................................................................................................
astropy/io/fits/tests/test_image.py ......................................................
astropy/io/fits/tests/test_nonstandard.py ...
astropy/io/fits/tests/test_structured.py .
astropy/io/fits/tests/test_table.py .........................................................s.................
astropy/io/fits/tests/test_uint.py ........
astropy/io/fits/tests/test_util.py .
astropy/io/misc/tests/test_hdf5.py sssssssssssssssssssssssssssssssssssssssss
astropy/io/misc/tests/test_pickle_helpers.py ....
astropy/io/tests/test_registry.py ..............................
astropy/io/votable/tests/converter_test.py ......................F
astropy/io/votable/tests/exception_test.py ..
astropy/io/votable/tests/table_test.py .........
astropy/io/votable/tests/tree_test.py ...
astropy/io/votable/tests/ucd_test.py .....
astropy/io/votable/tests/util_test.py ...........
astropy/io/votable/tests/vo_test.py ...........................................................................................................................................................................
astropy/modeling/_compound_deprecated.py ..
astropy/modeling/core.py .....
astropy/modeling/functional_models.py .
astropy/modeling/mappings.py ..
astropy/modeling/parameters.py .
astropy/modeling/utils.py ..
astropy/modeling/tests/test_compound.py ....................................................s
astropy/modeling/tests/test_constraints.py .....................
astropy/modeling/tests/test_core.py .............
astropy/modeling/tests/test_fitters.py ...................
astropy/modeling/tests/test_functional_models.py ............
astropy/modeling/tests/test_input.py ......................................................
astropy/modeling/tests/test_mappings.py ......
astropy/modeling/tests/test_models.py ..............................................ssss.ssssss.sss..................s..s....s...s.......................s.ss...s.ss............sssssss.ss....
astropy/modeling/tests/test_parameters.py .....................................................
astropy/modeling/tests/test_polynomial.py ............................s.........
astropy/modeling/tests/test_projections.py .......................................................................................
astropy/modeling/tests/test_rotations.py .............
astropy/modeling/tests/test_utils.py ...
astropy/nddata/utils.py ......
astropy/nddata/mixins/ndarithmetic.py .
astropy/nddata/mixins/tests/test_ndarithmetic.py .......................................................................................
astropy/nddata/mixins/tests/test_ndio.py .
astropy/nddata/tests/test_compat.py ................
astropy/nddata/tests/test_decorators.py ..........
astropy/nddata/tests/test_flag_collection.py ..........
astropy/nddata/tests/test_nddata.py ....................................
astropy/nddata/tests/test_nddata_base.py .
astropy/nddata/tests/test_nduncertainty.py ..................
astropy/nddata/tests/test_utils.py .....................................................
astropy/stats/bayesian_blocks.py .
astropy/stats/circstats.py ......
astropy/stats/funcs.py .....
astropy/stats/sigma_clipping.py ..
astropy/stats/tests/test_bayesian_blocks.py .......
astropy/stats/tests/test_circstats.py .........
astropy/stats/tests/test_funcs.py .....................................Fs..s
astropy/stats/tests/test_histogram.py .........
astropy/stats/tests/test_jackknife.py ...
astropy/stats/tests/test_sigma_clipping.py .....
astropy/table/info.py ..
astropy/table/meta.py ..
astropy/table/np_utils.py ..
astropy/table/operations.py ...
astropy/table/row.py .
astropy/table/table.py .............
astropy/table/table_helpers.py .
astropy/table/tests/test_array.py ...
astropy/table/tests/test_bst.py .......
astropy/table/tests/test_column.py ....................................................................................
astropy/table/tests/test_groups.py ......................................
astropy/table/tests/test_index.py ................................................................................................................................................................................................................................................................................................................................................................................................................................................
astropy/table/tests/test_info.py ............
astropy/table/tests/test_init_table.py ...................................................................................................................................................
astropy/table/tests/test_item_access.py ..............................
astropy/table/tests/test_jsviewer.py ....
astropy/table/tests/test_masked.py ..................................
astropy/table/tests/test_mixin.py ..............................................................x....
astropy/table/tests/test_np_utils.py .
astropy/table/tests/test_operations.py ......................................
astropy/table/tests/test_pickle.py ...............
astropy/table/tests/test_pprint.py ........................................................
astropy/table/tests/test_row.py ..................................
astropy/table/tests/test_subclass.py ..
astropy/table/tests/test_table.py ................................................................................................................................................................................................................................................................................................x.........................................
astropy/tests/test_logger.py .............................
astropy/tests/tests/test_imports.py ..
astropy/tests/tests/test_open_file_detection.py .
astropy/tests/tests/test_quantity_helpers.py .
astropy/tests/tests/test_run_tests.py ....
astropy/tests/tests/test_skip_remote_data.py s
astropy/tests/tests/test_socketblocker.py ....
astropy/time/core.py ....
astropy/time/formats.py ..
astropy/time/tests/test_basic.py ........................................................
astropy/time/tests/test_comparisons.py ...
astropy/time/tests/test_corrs.py ...
astropy/time/tests/test_delta.py .................................................................................
astropy/time/tests/test_guess.py ....
astropy/time/tests/test_methods.py ...............................................
astropy/time/tests/test_pickle.py .
astropy/time/tests/test_precision.py .......x..
astropy/time/tests/test_quantity_interaction.py ...............
astropy/time/tests/test_sidereal.py ...................
astropy/time/tests/test_ut1.py ...s
astropy/units/cds.py .
astropy/units/core.py ....
astropy/units/equivalencies.py ....
astropy/units/imperial.py .
astropy/units/format/console.py .
astropy/units/format/unicode_format.py .
astropy/units/function/logarithmic.py .
astropy/units/tests/test_equivalencies.py .....................................................
astropy/units/tests/test_format.py .................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
astropy/units/tests/test_logarithmic.py ...............................................................................................................................................................................
astropy/units/tests/test_physical.py ...........
astropy/units/tests/test_quantity.py ........................................................................
astropy/units/tests/test_quantity_array_methods.py ..............x...........................x.x.............
astropy/units/tests/test_quantity_decorator.py ............................
astropy/units/tests/test_quantity_non_ufuncs.py xx
astropy/units/tests/test_quantity_ufuncs.py ....................................ss.....................................................................................................................
astropy/units/tests/test_units.py ............................................................................................................................................................................................................................................................................................................................................................................................................................................
astropy/utils/data.py ....
astropy/utils/data_info.py ..
astropy/utils/decorators.py ....
astropy/utils/introspection.py ...
astropy/utils/metadata.py ..
astropy/utils/misc.py ...
astropy/utils/timer.py .
astropy/utils/iers/iers.py .
astropy/utils/iers/tests/test_iers.py ....s
astropy/utils/tests/test_argparse.py .
astropy/utils/tests/test_codegen.py .
astropy/utils/tests/test_collections.py .....
astropy/utils/tests/test_console.py .......s....................
astropy/utils/tests/test_data.py sssss...........s.....s.s..
astropy/utils/tests/test_data_info.py .............
astropy/utils/tests/test_decorators.py ........s..........
astropy/utils/tests/test_fractions.py .
astropy/utils/tests/test_gzip.py .
astropy/utils/tests/test_introspection.py ....
astropy/utils/tests/test_metadata.py .................
astropy/utils/tests/test_misc.py .s...
astropy/utils/tests/test_odict.py .
astropy/utils/tests/test_subprocess.py .
astropy/utils/tests/test_timer.py .
astropy/utils/tests/test_xml.py .........s
astropy/utils/xml/writer.py .
astropy/visualization/scripts/tests/test_fits2bitmap.py ......
astropy/visualization/tests/test_histogram.py ...
astropy/visualization/tests/test_interval.py .................
astropy/visualization/tests/test_norm.py s......
astropy/visualization/tests/test_stretch.py ...................................................................................................
astropy/visualization/tests/test_ui.py ......
astropy/visualization/tests/test_units.py ..
astropy/vo/client/tests/test_conesearch.py ssssssssssssss...x.
astropy/vo/client/tests/test_vos_catalog.py ..............s
astropy/vo/samp/tests/test_client.py ....
astropy/vo/samp/tests/test_errors.py ...
astropy/vo/samp/tests/test_hub.py ...
astropy/vo/samp/tests/test_hub_proxy.py .....
astropy/vo/samp/tests/test_hub_script.py .
astropy/vo/samp/tests/test_standard_profile.py ...
astropy/vo/samp/tests/test_web_profile.py ..
astropy/vo/validator/tests/test_inpect.py ....
astropy/vo/validator/tests/test_validate.py ssss
astropy/wcs/tests/test_pickle.py ......
astropy/wcs/tests/test_profiling.py ..................................
astropy/wcs/tests/test_utils.py .........................................
astropy/wcs/tests/test_wcs.py .............................................................................
astropy/wcs/tests/test_wcsprm.py ....................................................................................................x..........
astropy/wcs/tests/extension/test_extension.py .
../docs/changelog.rst .
../docs/credits.rst .
../docs/getting_started.rst .
../docs/index.rst .
../docs/install.rst .
../docs/known_issues.rst .
../docs/license.rst .
../docs/logging.rst .
../docs/overview.rst .
../docs/stability.rst .
../docs/testhelpers.rst .
../docs/warnings.rst .
../docs/analytic_functions/index.rst .
../docs/config/config_0_4_transition.rst .
../docs/config/index.rst .
../docs/constants/index.rst .
../docs/convolution/index.rst .
../docs/convolution/kernels.rst .
../docs/convolution/using.rst .
../docs/coordinates/angles.rst .
../docs/coordinates/definitions.rst .
../docs/coordinates/formatting.rst .
../docs/coordinates/frames.rst .
../docs/coordinates/galactocentric.rst .
../docs/coordinates/index.rst .
../docs/coordinates/matchsep.rst .
../docs/coordinates/observing-example.rst .
../docs/coordinates/remote_methods.rst .
../docs/coordinates/representations.rst .
../docs/coordinates/sgr-example.rst .
../docs/coordinates/skycoord.rst .
../docs/coordinates/transforming.rst .
../docs/cosmology/index.rst .
../docs/development/affiliated-packages.rst .
../docs/development/building.rst .
../docs/development/ccython.rst .
../docs/development/codeguide.rst .
../docs/development/codeguide_emacs.rst .
../docs/development/docguide.rst .
../docs/development/docrules.rst .
../docs/development/releasing.rst .
../docs/development/scripts.rst .
../docs/development/testguide.rst .
../docs/development/vision.rst .
../docs/development/workflow/additional_git_topics.rst .
../docs/development/workflow/command_history.rst .
../docs/development/workflow/development_workflow.rst .
../docs/development/workflow/get_devel_version.rst .
../docs/development/workflow/git_edit_workflow_examples.rst .
../docs/development/workflow/git_install.rst .
../docs/development/workflow/git_resources.rst .
../docs/development/workflow/maintainer_workflow.rst .
../docs/development/workflow/patches.rst .
../docs/development/workflow/terminal_cast.rst .
../docs/development/workflow/virtual_pythons.rst .
../docs/development/workflow/virtualenv_detail.rst .
../docs/io/misc.rst .
../docs/io/registry.rst .
../docs/io/unified.rst .
../docs/io/ascii/base_classes.rst .
../docs/io/ascii/extension_classes.rst .
../docs/io/ascii/fast_ascii_io.rst .
../docs/io/ascii/fixed_width_gallery.rst .
../docs/io/ascii/index.rst .
../docs/io/ascii/read.rst .
../docs/io/ascii/write.rst .
../docs/io/fits/index.rst .
../docs/io/fits/appendix/faq.rst .
../docs/io/fits/appendix/header_transition.rst .
../docs/io/fits/appendix/history.rst .
../docs/io/fits/usage/examples.rst .
../docs/io/fits/usage/headers.rst .
../docs/io/fits/usage/image.rst .
../docs/io/fits/usage/misc.rst .
../docs/io/fits/usage/scripts.rst .
../docs/io/fits/usage/table.rst .
../docs/io/fits/usage/unfamiliar.rst .
../docs/io/fits/usage/verification.rst .
../docs/io/votable/api_exceptions.rst .
../docs/io/votable/index.rst .
../docs/modeling/algorithms.rst .
../docs/modeling/bounding-boxes.rst .
../docs/modeling/compound-models.rst .
../docs/modeling/fitting.rst .
../docs/modeling/index.rst .
../docs/modeling/models.rst .
../docs/modeling/new.rst .
../docs/modeling/parameters.rst .
../docs/nddata/decorator.rst .
../docs/nddata/index.rst .
../docs/nddata/nddata.rst .
../docs/nddata/subclassing.rst .
../docs/nddata/utils.rst .
../docs/nddata/mixins/index.rst .
../docs/nddata/mixins/ndarithmetic.rst .
../docs/nddata/mixins/ndio.rst .
../docs/nddata/mixins/ndslicing.rst .
../docs/stats/index.rst .
../docs/table/access_table.rst .
../docs/table/construct_table.rst .
../docs/table/implementation_change_1.0.rst .
../docs/table/implementation_details.rst .
../docs/table/index.rst .
../docs/table/indexing.rst .
../docs/table/io.rst .
../docs/table/masking.rst .
../docs/table/mixin_columns.rst .
../docs/table/modify_table.rst .
../docs/table/operations.rst .
../docs/table/pandas.rst .
../docs/time/index.rst .
../docs/units/combining_and_defining.rst .
../docs/units/conversion.rst .
../docs/units/decomposing_and_composing.rst .
../docs/units/equivalencies.rst .
../docs/units/format.rst .
../docs/units/index.rst .
../docs/units/logarithmic_units.rst .
../docs/units/quantity.rst .
../docs/units/standard_units.rst .
../docs/utils/index.rst .
../docs/utils/numpy.rst .
../docs/visualization/histogram.rst .
../docs/visualization/index.rst .
../docs/visualization/normalization.rst .
../docs/vo/index.rst .
../docs/vo/conesearch/client.rst .
../docs/vo/conesearch/index.rst .
../docs/vo/conesearch/validator.rst .
../docs/vo/samp/advanced_embed_samp_hub.rst .
../docs/vo/samp/example_clients.rst .
../docs/vo/samp/example_hub.rst .
../docs/vo/samp/example_table_image.rst .
../docs/vo/samp/index.rst .
../docs/wcs/history.rst .
../docs/wcs/index.rst .
../docs/wcs/relax.rst .
../docs/whatsnew/0.1.rst .
../docs/whatsnew/0.2.rst .
../docs/whatsnew/0.3.rst .
../docs/whatsnew/0.4.rst .
../docs/whatsnew/1.0.rst .
../docs/whatsnew/1.1.rst .
../docs/whatsnew/index.rst .

=================================== FAILURES ===================================
_______________________________ test_gemini_v1_2 _______________________________

def test_gemini_v1_2():
    '''
    see Pull Request 4782 or Issue 4781 for details
    '''
  table = parse_single_table('data/gemini.xml')

astropy/io/votable/tests/converter_test.py:272:


source = 'data/gemini.xml', kwargs = {'table_number': 0}

def parse_single_table(source, **kwargs):
    """
    Parses a VOTABLE_ xml file (or file-like object), reading and
    returning only the first `~astropy.io.votable.tree.Table`
    instance.

    See `parse` for a description of the keyword arguments.

    Returns
    -------
    votable : `~astropy.io.votable.tree.Table` object
    """
    if kwargs.get('table_number') is None:
        kwargs['table_number'] = 0
  votable = parse(source, **kwargs)

astropy/io/votable/table.py:158:


source = 'data/gemini.xml', columns = None, invalid = 'exception'
pedantic = False, chunk_size = 256, table_number = 0, table_id = None
filename = None, unit_format = None, datatype_mapping = {}
_debug_python_based_parser = False

def parse(source, columns=None, invalid='exception', pedantic=None,
          chunk_size=tree.DEFAULT_CHUNK_SIZE, table_number=None,
          table_id=None, filename=None, unit_format=None,
          datatype_mapping=None, _debug_python_based_parser=False):
    """
    Parses a VOTABLE_ xml file (or file-like object), and returns a
    `~astropy.io.votable.tree.VOTableFile` object.

    Parameters
    ----------
    source : str or readable file-like object
        Path or file object containing a VOTABLE_ xml file.

    columns : sequence of str, optional
        List of field names to include in the output.  The default is
        to include all fields.

    invalid : str, optional
        One of the following values:

            - 'exception': throw an exception when an invalid value is
              encountered (default)

            - 'mask': mask out invalid values

    pedantic : bool, optional
        When `True`, raise an error when the file violates the spec,
        otherwise issue a warning.  Warnings may be controlled using
        the standard Python mechanisms.  See the `warnings`
        module in the Python standard library for more information.
        When not provided, uses the configuration setting
        ``astropy.io.votable.pedantic``, which defaults to False.

    chunk_size : int, optional
        The number of rows to read before converting to an array.
        Higher numbers are likely to be faster, but will consume more
        memory.

    table_number : int, optional
        The number of table in the file to read in.  If `None`, all
        tables will be read.  If a number, 0 refers to the first table
        in the file, and only that numbered table will be parsed and
        read in.  Should not be used with ``table_id``.

    table_id : str, optional
        The ID of the table in the file to read in.  Should not be
        used with ``table_number``.

    filename : str, optional
        A filename, URL or other identifier to use in error messages.
        If *filename* is None and *source* is a string (i.e. a path),
        then *source* will be used as a filename for error messages.
        Therefore, *filename* is only required when source is a
        file-like object.

    unit_format : str, astropy.units.format.Base instance or None, optional
        The unit format to use when parsing unit attributes.  If a
        string, must be the name of a unit formatter. The built-in
        formats include ``generic``, ``fits``, ``cds``, and
        ``vounit``.  A custom formatter may be provided by passing a
        `~astropy.units.UnitBase` instance.  If `None` (default),
        the unit format to use will be the one specified by the
        VOTable specification (which is ``cds`` up to version 1.2 of
        VOTable, and (probably) ``vounit`` in future versions of the
        spec).

    datatype_mapping : dict of str to str, optional
        A mapping of datatype names to valid VOTable datatype names.
        For example, if the file being read contains the datatype
        "unsignedInt" (an invalid datatype in VOTable), include the
        mapping ``{"unsignedInt": "long"}``.

    Returns
    -------
    votable : `~astropy.io.votable.tree.VOTableFile` object

    See also
    --------
    astropy.io.votable.exceptions : The exceptions this function may raise.
    """
    from . import conf

    invalid = invalid.lower()
    assert invalid in ('exception', 'mask')

    if pedantic is None:
        pedantic = conf.pedantic

    if datatype_mapping is None:
        datatype_mapping = {}

    config = {
        'columns'          : columns,
        'invalid'          : invalid,
        'pedantic'         : pedantic,
        'chunk_size'       : chunk_size,
        'table_number'     : table_number,
        'filename'         : filename,
        'unit_format'      : unit_format,
        'datatype_mapping' : datatype_mapping
    }

    if filename is None and isinstance(source, six.string_types):
        config['filename'] = source

    with iterparser.get_xml_iterator(
        source,
      _debug_python_based_parser=_debug_python_based_parser) as iterator:
        return tree.VOTableFile(
            config=config, pos=(1, 1)).parse(iterator, config)

astropy/io/votable/table.py:138:


self = <contextlib._GeneratorContextManager object at 0x7f0b16e5a9e8>

def __enter__(self):
    try:
      return next(self.gen)

/usr/lib/python3.4/contextlib.py:59:


source = 'data/gemini.xml', _debug_python_based_parser = False

@contextlib.contextmanager
def get_xml_iterator(source, _debug_python_based_parser=False):
    """
    Returns an iterator over the elements of an XML file.

    The iterator doesn't ever build a tree, so it is much more memory
    and time efficient than the alternative in ``cElementTree``.

    Parameters
    ----------
    fd : readable file-like object or read function

    Returns
    -------
    parts : iterator

        The iterator returns 4-tuples (*start*, *tag*, *data*, *pos*):

            - *start*: when `True` is a start element event, otherwise
              an end element event.

            - *tag*: The name of the element

            - *data*: Depends on the value of *event*:

                - if *start* == `True`, data is a dictionary of
                  attributes

                - if *start* == `False`, data is a string containing
                  the text content of the element

            - *pos*: Tuple (*line*, *col*) indicating the source of the
              event.
    """
  with _convert_to_fd_or_read_function(source) as fd:
        if _debug_python_based_parser:

astropy/utils/xml/iterparser.py:175:


self = <contextlib._GeneratorContextManager object at 0x7f0b16e5a908>

def __enter__(self):
    try:
      return next(self.gen)

/usr/lib/python3.4/contextlib.py:59:


fd = 'data/gemini.xml'

@contextlib.contextmanager
def _convert_to_fd_or_read_function(fd):
    """
    Returns a function suitable for streaming input, or a file object.

    This function is only useful if passing off to C code where:

       - If it's a real file object, we want to use it as a real
         C file object to avoid the Python overhead.

       - If it's not a real file object, it's much handier to just
         have a Python function to call.

    This is somewhat quirky behavior, of course, which is why it is
    private.  For a more useful version of similar behavior, see
    `astropy.utils.misc.get_readable_fileobj`.

    Parameters
    ----------
    fd : object
        May be:

            - a file object.  If the file is uncompressed, this raw
              file object is returned verbatim.  Otherwise, the read
              method is returned.

            - a function that reads from a stream, in which case it is
              returned verbatim.

            - a file path, in which case it is opened.  Again, like a
              file object, if it's uncompressed, a raw file object is
              returned, otherwise its read method.

            - an object with a :meth:`read` method, in which case that
              method is returned.

    Returns
    -------
    fd : context-dependent
        See above.
    """
    if six.callable(fd):
        yield fd
        return
  with data.get_readable_fileobj(fd, encoding='binary') as new_fd:
        if sys.platform.startswith('win'):

astropy/utils/xml/iterparser.py:66:


self = <contextlib._GeneratorContextManager object at 0x7f0b16e5a470>

def __enter__(self):
    try:
      return next(self.gen)

/usr/lib/python3.4/contextlib.py:59:


name_or_obj = 'data/gemini.xml', encoding = 'binary', cache = False
show_progress = True, remote_timeout = 3.0

@contextlib.contextmanager
def get_readable_fileobj(name_or_obj, encoding=None, cache=False,
                         show_progress=True, remote_timeout=None):
    """
    Given a filename, pathlib.Path object or a readable file-like object, return a context
    manager that yields a readable file-like object.

    This supports passing filenames, URLs, and readable file-like objects,
    any of which can be compressed in gzip, bzip2 or lzma (xz) if the
    appropriate compression libraries are provided by the Python installation.

    Notes
    -----

    This function is a context manager, and should be used for example
    as::

        with get_readable_fileobj('file.dat') as f:
            contents = f.read()

    Parameters
    ----------
    name_or_obj : str or file-like object
        The filename of the file to access (if given as a string), or
        the file-like object to access.

        If a file-like object, it must be opened in binary mode.

    encoding : str, optional
        When `None` (default), returns a file-like object with a
        ``read`` method that on Python 2.x returns `bytes` objects and
        on Python 3.x returns `str` (`unicode`) objects, using
        `locale.getpreferredencoding` as an encoding.  This matches
        the default behavior of the built-in `open` when no ``mode``
        argument is provided.

        When ``'binary'``, returns a file-like object where its ``read``
        method returns `bytes` objects.

        When another string, it is the name of an encoding, and the
        file-like object's ``read`` method will return `str` (`unicode`)
        objects, decoded from binary using the given encoding.

    cache : bool, optional
        Whether to cache the contents of remote URLs.

    show_progress : bool, optional
        Whether to display a progress bar if the file is downloaded
        from a remote server.  Default is `True`.

    remote_timeout : float
        Timeout for remote requests in seconds (default is the configurable
        `astropy.utils.data.Conf.remote_timeout`, which is 3s by default)

    Returns
    -------
    file : readable file-like object
    """

    # close_fds is a list of file handles created by this function
    # that need to be closed.  We don't want to always just close the
    # returned file handle, because it may simply be the file handle
    # passed in.  In that case it is not the responsibility of this
    # function to close it: doing so could result in a "double close"
    # and an "invalid file descriptor" exception.
    PATH_TYPES = six.string_types
    if HAS_PATHLIB:
        PATH_TYPES += (pathlib.Path,)

    close_fds = []
    delete_fds = []

    if remote_timeout is None:
        # use configfile default
        remote_timeout = conf.remote_timeout

    # Get a file object to the content
    if isinstance(name_or_obj, PATH_TYPES):
        # name_or_obj could be a Path object if pathlib is available
        if HAS_PATHLIB:
            name_or_obj = str(name_or_obj)

        is_url = _is_url(name_or_obj)
        if is_url:
            name_or_obj = download_file(
                name_or_obj, cache=cache, show_progress=show_progress,
                timeout=remote_timeout)
        if six.PY3:
          fileobj = io.FileIO(name_or_obj, 'r')

E FileNotFoundError: [Errno 2] No such file or directory: 'data/gemini.xml'

astropy/utils/data.py:199: FileNotFoundError
___________________________ test_scipy_poisson_limit ___________________________

@pytest.mark.skipif('not HAS_SCIPY')
def test_scipy_poisson_limit():
    '''Test that the lower-level routine gives the snae number.

    Test numbers are from table1 1, 3 in
    Kraft, Burrows and Nousek in
    `ApJ 374, 344 (1991) <http://adsabs.harvard.edu/abs/1991ApJ...374..344K>`_
    '''
  assert_allclose(funcs._scipy_kraft_burrows_nousek(5., 2.5, .99), (0, 10.67), rtol=1e-3)

astropy/stats/tests/test_funcs.py:513:


N = 5.0, B = 2.5, CL = 0.99

def _scipy_kraft_burrows_nousek(N, B, CL):
    '''Upper limit on a poisson count rate

    The implementation is based on Kraft, Burrows and Nousek
    `ApJ 374, 344 (1991) <http://adsabs.harvard.edu/abs/1991ApJ...374..344K>`_.
    The XMM-Newton upper limit server uses the same formalism.

    Parameters
    ----------
    N : int
        Total observed count number
    B : float
        Background count rate (assumed to be known with negligible error
        from a large background area).
    CL : float
       Confidence level (number between 0 and 1)

    Returns
    -------
    S : source count limit

    Notes
    -----
    Requires `scipy`. This implementation will cause Overflow Errors for
    about N > 100 (the exact limit depends on details of how scipy was compiled).
    See `~astropy.stats.mpmath_poisson_upper_limit` for an implementation that is
    slower, but can deal with arbitrarily high numbers since it is based on the
    `mpmath <http://mpmath.org/>`_ library.
    '''
    from scipy.optimize import brentq
    from scipy.integrate import quad
  from scipy.special import factorial

E ImportError: cannot import name 'factorial'

astropy/stats/funcs.py:1164: ImportError
======= 2 failed, 7518 passed, 131 skipped, 40 xfailed in 167.53 seconds ======

@pllim
Copy link
Member

pllim commented Apr 18, 2016

@al-niessner , hard to say because I don't know how your system is set up. To be sure, push your commit with the test and test data file addition to your PR and let Travis CI run the tests.

@bsipocz
Copy link
Member

bsipocz commented Apr 18, 2016

@al-niessner - Every test sessions have a "header", listing the version numbers of both the tested package and its dependencies. Your first scenario says:

Running tests with Astropy version 1.0.3.
Running tests in /usr/local/lib/python3.4/dist-packages/astropy/io/votable.

This means that you're testing an installed (and may I say not up-to-date) version, and not the one you modified.

Another trick: - For inserting long log outputs like above ones, I find it better to use gist (https://gist.github.com/), posting only the link keeps a clearer overview of the PRs/issues.

@al-niessner
Copy link
Contributor Author

Thanks. Enough info for me to fix all of my paths and get it working
both in python3 and setup.py test.

On Mon, 2016-04-18 at 11:58 -0700, Brigitta Sipocz wrote:

@al-niessner - Every test sessions have a "header", listing the
version numbers of both the tested package and its dependencies. Your
first scenario says:

Running tests with Astropy version 1.0.3.
Running tests in /usr/local/lib/python3.4/dist-packages/astropy/io/votable.

This means that you're testing an installed (and may I say not
up-to-date) version, and not the one you modified.

Another trick: - For inserting long log outputs like the above, I find
it better to use gist (https://gist.github.com/), posting the link
only keeps a clearer overview of the PRs/issues.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@pllim
Copy link
Member

pllim commented Apr 19, 2016

@al-niessner , I'm pretty sure the AppVeyor error will go away if you rebase, so I am not worried about that. However, are you comfortable with squashing your 11 commits into 1? If not, I'll attempt to do it via a separate PR. Except for the squashing, I think this is good to merge. Please let me know.

@al-niessner
Copy link
Contributor Author

I think I got the rebase this time. It was the push up that was causing
me grief. My paranoid behavior prevents me from push -f but I guess the
rebase requires it to work correctly.

On Tue, 2016-04-19 at 06:40 -0700, P. L. Lim wrote:

@al-niessner , I'm pretty sure the AppVeyor error will go away if you
rebase, so I am not worried about that. However, are you comfortable
with squashing your 11 commits into 1? If not, I'll attempt to do it
via a separate PR. Except for the squashing, I think this is good to
merge. Please let me know.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@pllim
Copy link
Member

pllim commented Apr 19, 2016

@al-niessner , almost there! Side effect of the squash is somehow the duplicate change log entries are back. Please remove them (again) and just leave one under 1.1.3 bug fix. No need to squash again. Thanks!

'''
see Pull Request 4782 or Issue 4781 for details
'''
table = parse_single_table (get_pkg_data_filename ('data/gemini.xml'))
Copy link
Member

Choose a reason for hiding this comment

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

Remove the space before the ( (twice)

@astrofrog
Copy link
Member

@al-niessner - it would be great if you could squash both commits into one (and keep only the commit message for the first)

@al-niessner
Copy link
Contributor Author

I had a request not to squash from plim. So not squashing until I get a
more or less constant voice from y'all on doing so since you
instructions specifically state never to squash unless told to do so.

On Tue, 2016-05-10 at 03:13 -0700, Thomas Robitaille wrote:

@al-niessner - it would be great if you could squash both commits into
one (and keep only the commit message for the first)


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@pllim
Copy link
Member

pllim commented May 10, 2016

Yeah, I did say that because I worry that squashing again would bring back the duplicate change log entry. But now it looks like there are 3 commits. So I am for squashing again, but we just have to make sure it does not produce unintended side effects (like the duplicate change log entry). Thanks!

@al-niessner
Copy link
Contributor Author

Done as requested. Pretty trite changes and your group would benefit
from a pretty printer rather than asking developers to "code your way".
However, it is teaching me what never to do.

On Tue, 2016-05-10 at 03:13 -0700, Thomas Robitaille wrote:

@al-niessner - it would be great if you could squash both commits into
one (and keep only the commit message for the first)


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@al-niessner
Copy link
Contributor Author

Trying but getting this strange error and not sure how forceful you want
me to be:

$ git rebase -i HEAD-3
fatal: Needed a single revision
invalid upstream HEAD-3

As best I can tell from gitk the branch is just 3 straight forward
commits from branch point.

On Tue, 2016-05-10 at 07:45 -0700, P. L. Lim wrote:

Yeah, I did say that because I worry that squashing again would bring
back the duplicate change log entry. But now it looks like there are 3
commits. So I am for squashing again, but we just have to make sure it
does not produce unintended side effects (like the duplicate change
log entry). Thanks!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@al-niessner
Copy link
Contributor Author

Search on google was not helpful and all suggestions ended in using
--root which seems absolutely the wrong thing to do. So, no squashing
for me until somebody with better git kung fu helps me out.

I will say that it seems to be related to already having squashed the
branch.

On Tue, 2016-05-10 at 07:45 -0700, P. L. Lim wrote:

Yeah, I did say that because I worry that squashing again would bring
back the duplicate change log entry. But now it looks like there are 3
commits. So I am for squashing again, but we just have to make sure it
does not produce unintended side effects (like the duplicate change
log entry). Thanks!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@pllim
Copy link
Member

pllim commented May 10, 2016

The correct incantation is git rebase -i HEAD~3 (tilda, not minus sign). Would you like to give that another try? Thanks!

…ed the documentation as requested. Added a test unit and supporting data for the test. Squashed all of the commits to this single commit as requested.
@al-niessner
Copy link
Contributor Author

Done and should not have odd change log problem.

On Tue, 2016-05-10 at 08:10 -0700, P. L. Lim wrote:

The correct incantation is git rebase -i HEAD~3 (tilda, not minus
sign). Would you like to give that another try? Thanks!


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

Al Niessner

I have never found the companion that was so companionable as solitude.

  • From Walden by Henry David Thoreau

The universe is indifferent, and life is brutal; however, it is man's
choice of behavior that makes them malevolent rather than benevolent.

Some will fall in love with life and drink it from a fountain
That is pouring like an avalanche coming down the mountain.

  • From the song Pepper by the Butthole Surfers

@astrofrog
Copy link
Member

Thanks @al-niessner!

@pllim
Copy link
Member

pllim commented May 10, 2016

Looks good, thank you!

@astrofrog astrofrog merged commit 455f0fa into astropy:master May 11, 2016
@astrofrog astrofrog mentioned this pull request May 17, 2016
2 tasks
@astrofrog astrofrog modified the milestones: v1.2.0, v1.1.3 May 17, 2016
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