Repository navigation
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
nstarman
left a comment
There was a problem hiding this comment.
Thanks for the PR! Overall I think this looks very good. The Quantity code is performance critical. Can you provide some timing tests showing the performance impact. Thanks and happy new year 🎆
Thanks for review - I am happy the code is good overall I am working on it (using asv) and will update the PR shortly Have a nice start of the year 😊 |
|
Hi! @nstarman, for the past day, I have been working to provide timing tests for my code. Here is how I did it. I wonder if I did the right thing:
My inference is that the code is working fine, but I am not sure. I would be glad if you could suggest what actions can be taken further Have a nice day 😉 |
|
Hi @kartavayv, that's a good way to do it, but even doing |
|
Hi @nstarman, thanks for helping me out! (can't believe I am talking to real astrophysicists!!!!) I checked for the potential overhead by benchmarking
so, I think it is working perfectly fine, suggesting no regression for normal string parsing Regarding the split suggestion: if you think it's preferable, I am happy to do so! |
|
@nstarman should I make some improvements in this...!!!? |
|
@kartavayv, sorry for the delay. |
|
Hey @nstarman , from what I can understand, you are asking me to make changes in the units because there is no inverse parser from LaTeX -> Units ...? I think it's probably because my code uses a workaround Thanks for your time 😊 |
|
Hi @kartavayv! Actually, I'm just asking for you to cherrypick your units-related code changes and make a new PR to |
d08e712 to
4ec5997
Compare
311cad3 to
1b8702b
Compare
|
Rebased this branch back onto main, latex branch, and units-quantity-parsing branch are made for different purposes, so it's not a good idea to rebase one onto another! |
|
@nstarman - Made some changes, just like you said (very helpful!). I think this will also help in the future n-D tensor parsing. Performance Stats
|
| # Works with the assumption that all the incoming data in the pipeline is an ndarray. | ||
| if col.value.ndim > 1: | ||
| col.str_vals = [str(val) for val in col.value] | ||
| else: | ||
| col.str_vals = list(col.info.iter_str_vals()) | ||
|
|
There was a problem hiding this comment.
@taldcroft if you have the time, I'd appreciate your thoughts on this change. Thanks!
| table = QTable.read(filename, format="ascii.latex", **kwargs) | ||
|
|
||
| # No need of units of different cosmology parameters to support cosmology conversion | ||
| del table[0] |
There was a problem hiding this comment.
Can you try removing this line? The comment makes me worry that there are some unit problems being hidden!
|
What was the specific error related to mandatory units? |
|
Some of the generalized test functions that are failing:
Not using These seem like generalized functions for various formats, so adding |
|
@nstarman - is there a better way to do it....? Something I might be missing...? |
Ok. Got it. Yes, this is a good point. It's not that the method with required kwargs Some things I'm seeing.
# Collect the registered read/write formats.
# (format, supports_metadata, has_all_required_dependencies)
readwrite_formats = [
("ascii.ecsv", True, True),
("ascii.html", False, HAS_BS4),
("ascii.latex", False, True),
("json", True, True),
("latex", False, True),
]to include a 4th elt in each tuple which is "supports units". So
|
8c42629 to
42a134c
Compare
|
It looks like the test failures are only small changes to the docs: |
There was a problem hiding this comment.
@taldcroft could you take a look at this change. Is this alright? 🤞
There was a problem hiding this comment.
Ping @taldcroft, could you confirm editing astropy.io.ascii here is fine?
|
@nstarman - sorryy for this very long delay!
|
|
I haven't made last arg in |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 5 months. I plan to close this in a month if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
03a000d to
85f2c54
Compare
85f2c54 to
1e35513
Compare
Updated Context
I think this is ready for merge! |
|
@dhomeier - can you look into this? |
|
I checked for CI failures; it's affecting almost all new PRs... |
|
CI should be fixed now. Please rebase. |
a9216bf to
fe0b49c
Compare

This PR seeks to fix the issue of not having a LaTeX reader for Cosmology. It provides functionality to convert back to Cosmology from a LaTeX file.
Changes made :
read_latexfunction in latex.py to be able to read LaTeX back to Cosmologycore.pyandquantity.pyto support the conversionHow it was fixed:
A simple function was made that converts LaTeX into a table and puts it into
from_table. Some changes have to be made in some core modules likecore.pyandquantity.pyto actually support reading it back.Also, a few changes were made in how
m_nuwhich was causing a problem:ValueError: '.. 0.06' did not parse as unit...is saved in a LaTeX file (0.0 .. 0.006->[0. 0. 0.006]) (first one hides the middle value). To support this, some changes were made incore.py, and to support reading it back to Cosmology, some modifications were made inquantity.py.Fixes: #14837