Repository navigation
Conversation
this direcly uses CDSTable class from cdspyreadme [skip ci]
|
Hello @Suyog7130 👋! It looks like you've made some changes in your pull request, so I've checked the code again for style. There are no PEP8 style issues with this pull request - thanks! 🎉 Comment last updated at 2021-06-27 17:45:35 UTC |
|
👋 Thank you for your draft pull request! Do you know that you can use |
|
Thanks for opening the PR! Glad to see code already 😄 Before I take a close look and give you detailed comments, I want to note a few things:
This might seem like a lot of comments, but they are meant to help you throughout your GSoC work (please don't be disheartened!) This is just the first week so we don't expect you to have everything figured out (that is why GSoC is a few months long 😃). We can discuss this more next week! |
it was only a matter of inheriting the `fixedWidth.fixedWidthData` class instead of `core.BaseData` the error that the `widths` argument value is missing in `self.splitter.join()`, was also due to this. The Splitter class was `fixedWidth.fixedWidthSplitter` but the data class was different. Also, all the table data is stored in `self.cols` which is created and then updated in `core.BaseReader.write` function before the call to individual writers. Now it\'s super straight-forward to go ahead. Already `Cds.write` can write the table data. Hurray! [skip ci]
0199796 to
a6cf730
Compare
|
Hi, I have got the |
|
Don't worry if the tests run but should not. I've seen the [skip ci] fail in other cases, too. Not sure why. We try to save the electricity, but if it does not work, then it does not work and it's not our job to debug that. |
this is for have left aligned CDS table data written to a separate file. [skip ci]
[skip ci]
this is done via `test_write_data` func in `test_cds.py` [skip ci]
|
@Suyog7130 and mentors. Just saw this and didn't realize this was a GSoC project, but great! One question I have is about the flavor of CDS and whether to focus on the AAS Machine Readable Table (MRT, https://journals.aas.org/mrt-overview/) variant. In the original thread it was suggested to write as AAS MRT instead of CDS (#11257 (comment)). Certainly for publishing to AAS journals this is what is needed. Who knows, maybe you can do both (as implied in the A few thoughts:
|
|
I think CDS and AAS formats are close enough that it's easy to do the other one, once we have one of them in place or to declare features where they differ to be beyond the scope of this reader. I don't have strong feelings about which one to start with. I fact, I thought that there are compatible (we read them with the same reader), with maybe some difference on the default naming convention for columns. Notably, some of the associations between columns that the standard talks about (https://journals.aas.org/mrt-labels/#reflab) will always be left to the user - astropy has no way of knowing that column B holds "a note or remark" on the entries of column A and thus column be should be named "n_A". In that sense, the reader will be functionally OK, but it will probably require the user to rename the columns appropriately before writing in Python or after writing with a simple text editor on the written out column. I think that's not a problem - journal have data editors who will check this stuff. Other notes:
We welcome your thoughts on how to do that best @taldcroft. One of the downsides of "GSOC + github" is that github does not cover the entire discussion because some of it happens live on zoom. |
The Agreed that the label standards are in ways difficult to enforce, but there are opportunities to use the standard for better integration with astropy mixins. In particular a SkyCoord column can be represented in MRT/CDS, and likewise a Time column has a recommended MRT/CDS representation. |
the spacing between the ByteByByte rows is not good. [skip ci]
I should make use of the `widths` already obtained for formatting the lines of ByteByByte. Let's try that. [skip ci]
the use of `CDSColumn.py` can be removed, because we would want the whole writer to be integrated within astropy. There are numerous astropy features like the coordinates etc. that can employed in replacing cdspyreadme codes. One great thing would be to write ByteByByte as an `astropy.table.Table` object. I am gonna try that next. [skip ci]
aaryapatil
left a comment
There was a problem hiding this comment.
A few more general comments on the code; will provide a detailed review once you push the changes you are currently working on.
| @@ -0,0 +1,529 @@ | |||
| """ | |||
| G.Landais (CDS) 28 nov 2015 | |||
| CDSColumn, used to Generate ReadMe and CDS standardized tables (in ASCII aligned columns) | |||
There was a problem hiding this comment.
Based on all the helpful comments on this PR, you could entirely remove this file or (even better) squash the first few commits when you added this file (and some others). Refer to How to Squash if you haven't used squash before. @Suyog7130, you already mentioned that you will be removing any changes you directly included from cdspyreadme -- I just wanted to provide information regarding how to squash so that you are on track!
|
I understand this is still early in the code development, but at some point the variable and method naming will need to comply with PEP8 in order to be merged. Module level constants should be SCREAMING_SNAKE_CASE, and method and variable names should be lower case like |
remove template file [skip ci]
|
@Suyog7130 - can you please try again with the |
96c3cd0 to
2b37332
Compare
|
Hi @taldcroft and others, Thanks for reaching out and for the valuable suggestions. I had meant this PR as a pseudo-work space where the changes I make can be viewed and discussed by others. This PR is not meant to be the final one(s) which will be put up for merging. I shall squash and remove edits that are not required before doing so. That's why this PR is marked Draft. I wanted to have something working quite early in the project, in order to be able to pinpoint accurately when something doesn't work. This is why I started with directly adding the About the reading/writing to MRT, in fact I wrote about it briefly in my GSoC Proposal that I could attempt it as an extension. I don't have an opinion on whether or not it should have it's own format classes etc. However, since the title of my GSoC project is to Add a CDS format writer to Astropy, I would prefer to work on the CDS format writer first and then on the MRT format. The MRT header anyway appears to be a bit simpler than the CDS header, so there shouldn't be much difficulty in the extension. So, in a nutshell, this is my workflow:
I have completed the first three tasks and will now work on the fourth. I think by the time this finishes, a separate
There's a tool anafile (http://vizier.u-strasbg.fr/doc/anafile.htx) available from CDS which checks if a given ReadMe matches the table data or not. I think I can later on write something similar to match the table data with the ReadMe. This would raise an error when MRT file is been read using CDS reader and vice-versa.
Yup! I would keep it in mind. If I overlook something, it can of course be corrected towards the end before the PR is merged. Following Aarya's first comment about the PEP8 I have started to use
Looks like all but two tests are getting skipped now, which is good. I had tried adding |
|
@Suyog7130 - thanks for the great response and summary. Just some quick points on priority:
I'm not aware of any interest in the community for being able to write separate files like this. Maybe I'm just missing this, but every time this has come up, people are strongly opposed to the separate header / data file. In general this is just causes problems. On the other hand, during discussion of writing CDS-style files, there was unanimous agreement that the MRT format should be the priority, including from the author of cds.pyreadme. So I just ask that you keep that in mind and make sure there is time for MRT. |
deleted `CDSColumn.py` [skip ci]
also, renamed `borne` to `limVals` added checking for `mag` units in BBB added `re` match group names [skip ci]
|
Discussions continued in #11897. |
Description
This pull request is to address issue #11257.
Have directly used
CDSTableclass fromcdspyreadmeas of now.@aaryapatil and @hamogu, please have a look.
[skip ci]