cds-astro / cds.pyreadme

ReadMe and MRT builder for authors
Other
33 stars 6 forks source link

SPecifying the format for the columns in the ReadMe #1

Closed mkenworthy closed 1 year ago

mkenworthy commented 3 years ago

Hello,

Many thanks for this module!

I want to specify the formatting for the output columns in the output files - even though I have specified a format in an astropy Table object '{:5.2f}' for example - the tablemaker.makeReadMe() writes out either Float format or occasionally Scientific Exponential format - if you look at line 3 in the two ReadMe files below, you see one is F7.5 but the other is E5.1

How do I force makeReadMe() to write out a specific format?

I assume it is something I can set in a CDSColumn but I cannot work out what variable I need to set in the CDSColumn....


Bytes Format Units Label Explanations

1- 9 F9.3 d time [57696.87/58233.38] MJD 11-20 E10.3 flux flux normalised flux - 1.0 22-28 F7.5 flux ferr [0.0/0.01] error on flux

...but a similar file gives:

Byte-by-byte Description of file: bring1

Bytes Format Units Label Explanations

1- 9 F9.3 d time [57786.82/58349.78] MJD 11-20 E10.3 flux flux normalised flux - 1.0 22-26 E5.1 flux ferr error on flux

gilleslandais commented 3 years ago

Hello - Thank you for the feedback - it is an interesting issue.

I updated recently the library with an option to specify format. see function set_format applied on CDSColumn. There is an example in the github ReadMe https://github.com/cds-astro/cds.pyreadme.