Coder Social home page Coder Social logo

cds.pyreadme's People

Contributors

gilleslandais avatar manonmarchand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cds.pyreadme's Issues

Make the README examples work using files in the repo

Currently the README examples rely on fictitious files like file.csv or table.vot. This makes it difficult to try out the examples. If example files were placed in a directory (for example examples), then it would be possible for the user to copy/paste all the examples and more quickly understand how to use the package.

Units not printed to ReadMe

Hi,
I found that the addTable does not keep the units from a Table (from astropy.table import Table).
So, there are no units in the Byte-by-byte Description of file, only ---, even if the Table has the each column with own unit.

Doing something like this:

data1 = np.random.normal(loc=0, scale=1, size=(1000,3))  
data1_names = ["col1", "col2", "col3"]  
data1_descriptions = ["Column 1", "Column 2", "Column 3"]  
data1_table = Table(data1, names=data1_names)  
for i, n in enumerate(data1_names):  
  col = data1_table[n]  
  col.description = data1_descriptions[i]  
  col.unit = "u{}".format(i+1)  
tablemaker = cdspyreadme.CDSTablesMaker()  
table1 = tablemaker.addTable(data1_table, "Table1.dat", description="This is the description of Table1.dat")  
tablemaker.writeCDSTables()  
tablemaker.makeReadMe()  

Produces this:

(1st author ?, Date ?)
================================================================================
Title ?
    1st author ?, Authors ?
    =ref ?
================================================================================
Keywords: 

Objects:
    -----------------------------------------
       RA   (2000)   DE    Designation(s)
    -----------------------------------------

Abstract:
  Abstract ?

File Summary:
--------------------------------------------------------------------------------
 FileName    Lrecl   Records    Explanations
--------------------------------------------------------------------------------
ReadMe         80        .  this file
Table1.dat     68     1000  This is the description of Table1.dat


--------------------------------------------------------------------------------
Byte-by-byte Description of file: Table1.dat
--------------------------------------------------------------------------------
 Bytes Format Units  Label     Explanations
--------------------------------------------------------------------------------
 1-22   F22.19 ---    col1    [-3.01/3.01] Column 1
24-45   F22.19 ---    col2    [-3.24/3.11] Column 2
47-68   F22.19 ---    col3    [-2.78/3.29] Column 3

--------------------------------------------------------------------------------



See also:
None

Acknowledgements:

References:
================================================================================
     (prepared by author  / pyreadme )

However, great work!
Cheers,
Luca

ValueError: bad marshal data (unknown type code)

Hi! I had the following error during the execution of python3 setup.py install --user :

ValueError: bad marshal data (unknown type code)

It was solved by removing all *.pyc files included in the source code.

How do you prevent a column from being rounded?

Expected behavior:
A column of floats has all decimal places persevered.

Actual behavior:
A column of floats is rounded to two digits and put into scientific notation (i.e. 0.951366 is displayed as 9.5e-2).

Steps to reproduce:
I follow the example on the readme and I've tried explicitly defining the format with set_format, but that seems to be ignored.
I'm using an astropy table with ~1.6 million rows, so it'd be difficult to share the actual data. Not all float columns have this behavior and it doesn't happen when I use a test set of only 100 rows--I see the actual behavior when I load the entire dataset.

Version: 1.3.0

Install fail due to problems with logging module

 % pip install git+git://github.com/cds-astro/cds.pyreadme.git

fails due to a problem with installing the dependency "logging" from pypi.
Is this dependency needed? I though logging was included already in any recent version of python.

SPecifying the format for the columns in the ReadMe

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

makeReadMe() fails when columns contain NaN values, writeCDSTables() replaces NaN values with zero.

Hi, I have some astropy tables which I am converting into CDS tables for upload. Some of the physical quantities for my table entries are missing, and those array elements are filled with NaNs.

The writeCDSTables() runs without crashing, but replaces all NaN values with 0 (this is problematic).

The makeReadMe() crashes and returns: ValueError: cannot convert float NaN to integer, and hence does not generate an output.

Is there a way for NaN values to be supported?

Many thanks.

Version: 1.3.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.