Closed jgieseler closed 2 years ago
@jgieseler Nice catch, this indeed come from an incomplete manual sanitizing of such names here.
I didn't find a better solution at that time...
I'll push a fix ASAP. The fun thing here is that you can generate invalid python names using __dict__
but there is no way to use them afterwards (except using __dict__
).
@jgieseler if you want to try the fix, you can install what will be the 0.10.0 with
pip install git+https://github.com/jeandet/speasy@documentation_update_v0.10
Yes, that seems to work!
>>> import speasy as spz
>>> amda_tree = spz.inventory.data_tree.amda
>>> amda_tree.Parameters.PSP.ISoISEPI_Hi
AMDAPathIndex(name='IS⊙IS EPI-Hi', desc='Energetic Particle Instrument Hi-Energy<br/>SolidStateDetector', xmlid='PSP_epihi', att='auto/PSP_epihi', is_public=True, HET=AMDAPathIndex(xmlid='psp-isois-het', name='HET', is_public=True, psp_het_1hr=<DatasetIndex: HET 1h>, psp_het_1min=<DatasetIndex: HET 1min>), LET1=AMDAPathIndex(xmlid='psp-isois-let1', name='LET1', is_public=True, psp_let1_1hr=<DatasetIndex: LET1 1h>, psp_let1_1min=<DatasetIndex: LET1 1min>), LET2=AMDAPathIndex(xmlid='psp-isois-let2', name='LET2', is_public=True, psp_let2_1hr=<DatasetIndex: LET2 1h>, psp_let2_1min=<DatasetIndex: LET2 1min>))
And I think it's not really a problem; I've seen it written with an "o" already somewhere else. Even the instrument team has to use this workaround for its URL: https://spp-isois.sr.unh.edu 😉
Description
When trying to address data of Parker Solar Probe's (PSP) particle instruments "IS⊙ISEPI_Hi" or "IS⊙ISEPI_Lo" via dynamic inventory, the special sign "⊙" causes a
SyntaxError: invalid character
.What I Did
First create a clean Python 3.9 environment with conda, install latest speasy version from git via pip, and start python:
Then in python:
Running
amda_tree.Parameters.PSP.FIELDSMAG
just to verify that it works in general. Trying to replace "⊙" with "0/O/o" doesn't solve the problem.