Repository navigation
For single columns, store standard info on Column. - #14
Conversation
|
@taldcroft - did you see this PR to your branch - it now doesn't merge any more, but one benefit it did have was not repeating the unit information when not necessary. |
|
I had not seen this but will look now. |
442bed0 to
a9105d8
Compare
|
@taldcroft - I rebaed this on your current version, made it quite a bit cleaner, and added recursive serialization (using |
|
Awesome, the dynamic @mhvk + @taldcroft duo continues!! 😄 I like this much better. Just got in from a flight and did not study the new code in much detail, but have looked at the serialized output and agree this is good. About "so that Table can store EarthLocation as well", isn't that a lost cause? If you try to put an Anyway, please continue with your development and I will merge when you say you've finished. |
|
Fun fact - this whole thing is predicated on an interesting "feature" of Table.add_column: Note that |
|
With your approach maybe it makes sense to replace the key |
|
Yes, agreed, As for |
|
I don't think For a Agreed it's all a little confusing, but I'll stand by the original reasoning that got us here. So the upshot is to use QTable if you are using Quantity in your code, end of story. |
|
OK, I agree we should not try to make the table initializer recognize But currently, if I write out with One solution may be to work with |
|
I think the behavior should be exactly consistent with our current API and docs for casting from one class to another. I.e. QTable(qtable) round-trips perfectly, Table(qtable) converts Quantity (and subclasses) to Column + unit (with potential loss of information because the Quantity subclass is lost), QTable(table) will convert Column + unit to Quantity, etc. So the ECSV is an intermediate representation that should be agnostic about what the final output will be. I think that is actually the case now, no? |
|
@taldcroft - currently, the |
|
@mhvk - hmm, it seems there is a slight problem. If one does However, in order that I thought about this for a few minutes and did not see any easy low-impact solution. Maybe you can? Otherwise this is awesome and looking very close. After merging this I think there is just documentation related stuff. |
Really only to see whether it would work -- implemented too crappily to suggest using it directly. But with this, e.g.,
I'm slightly wondering whether for single columns one could not just as well directly go through
SerializedColumn, i.e., that this would be(name is obvious;
valuewould be implied). That would certainly solve the annoyingifstatements in the current crappy implementation.With that, I think it would also extend naturally to
jd1(classndarray), and any regulardictwould mean a level of recursion to get theSerializedColumnout (or another dict, and another level of recursion).Anyway, really too tired -- I should have gone to sleep hours ago -- but this is very nice and I couldn't resist playing with it!