Add support for reading and writing fixed width tables.
Minor features and bug fix release:
- Add a method inconsistent_handler() to the BaseReader
class as a hook to handle rows with an inconsistent number
of data columns (contributed by Erik Tollerud).
- Output a more informative error message when guessing fails.
- Fix issues in column type handling, mostly related to the
MemoryReader class which is used for writing tables.
- Fix a problem in guessing where user-supplied args were
not filtering the guess possibilities correctly.
- Fix problem reading a single column, string-only table with
MemoryReader on MacOS.
Fixed CDS docstrings so they pass doctest.
Thanks Segio Pascual for sending this fix.
Fixed setup.py to install asciitable package instead asciitable.py module.
This is a significant release with the following key features:
- Added support for reading and writing LaTeX tables
(contributed by Moritz Guenther).
- Improved the CDS reader by better supporting multi-file
tables (contributed by Frederic Grollier).
- Refactored the code into a package with functionally distinct modules.
- Added "type" attribute in the Column class that provides the
type of a column as IntType, FloatType, or StrType.
The new Latex and AASTex classes provide the ability to write
publication quality LaTeX tables in both the standard and AAS
"deluxetable" formats. These classes provide hooks to inject
additional LaTeX commands as needed for more complex tables.
- Previously the read(), write(), get_reader() and get_writer()
raised an exception for unrecognized keyword arguments. Now
those extra arguments are passed on to the Reader class
constructor. From the user perspective this means you can call
read()/write() with class initialization arguments (see Cds and
Latex for examples). For developers it means more flexibility
in Reader classes.
- One minor API change is not backward compatible. When
specifying custom column converters (e.g. to force a column
that looks like integers to convert to floats) it was
previously possible to provide either a list of converters or a
single converter. Now you must always provide a list of
converters even it is has only one element. This was needed to
support consistent assigment of the Column.type attribute.
Other minor fixes:
- Fixed a bug when the "end_line" parameter is passed a function.
- Fixed a bug where the RDB writer issued incorrect column types.
Add support and testing for MacOS and Windows.
- Fixed issue reading a table from a string under Windows.
- Added testing using Python 2.7 for Windows XP and MacOS 10.6.
- Changed Python 3 testing on linux from 3.1 to 3.2.
- Added pip and easy_install instructions to the installation documentation.
- Added __version__ variable to module.
- Removed download_url from setup.py since tar file is hosted on PyPI now.
Enhance CDS reader support for missing values and fix a bug in NumpyOutputter
related to masking.
Cds tables can contain missing values, realized as empty stings or with special
values. These special values are then given in the first few characters of the
column description in the form ?=value. For columns with float values (type E
and F) asciitable now implements an automated setting for fill_values, that masks
these spacial values in a masked array. Nothing has changed for ascii or
integer columns as these do not have a natural value which can be used to
replace the masked or missing values in a transparent way.
Fix a bug in NumpyOutputter if a mask is defined by no value is masked.
This release is primarily an update to the CDS format reader with code
contributed by Prasanth Haridas Nair. It now can handle separate ReadMe and
data files. The ReadMe file specifies the column information for one or more
associated data files. For example:
>>> readme = "t/vizier/ReadMe"
>>> r = asciitable.Cds(readme)
>>> table = r.read("t/vizier/table1.dat")
>>> table5.dat has the same ReadMe file
>>> table = r.read("t/vizier/table5.dat")
In addition a minor bug was fixed where blank table lines were not
being properly ignored.
This release features a new function to guess the table format from the
supported formats within asciitable. This function is now called by default
within asciitable.read(). In addition:
- Added support for whitespace (tab or space) delimited tables by setting
the delimiter parameter to "\s".
- Improved support for RDB tables by parsing the second line which specifies
column type and (optionally) width. These values are written out if
available when writing an RDB table.
- More rigorous checking of format compatibility for several table formats.
Add capability to handle bad or missing values in the input table. This is
done with a new fill_values parameter that specifies replacement of
particular bad or missing values with new values. When used with NumPy
the default output will be a NumPy masked array.
Contributed by Moritz Guenther
This release features the new capability to write ASCII tables using the same
basic infrastructure and API as for reading. Other updates include:
- Python 3 compatibility
- Significant documentation updates
- Improved test coverage
- New Reader class to read in-memory tables
Primarily a documentation update, including much more detail on the parameters
for the read() function plus a bit more for other advanced features. There are
a couple of minor code fixes / updates:
- Gracefully read tables that have a header but no data lines.
- Update the Tab reader so all data value spaces are preserved
Add IPAC reader and reader comment_lines attribute plus doc updates.
- Add IPAC format reader
- Add 'comment_lines' attribute to BaseReader class to return all lines
matching the header comment character.
- Made the table lines retrieved by the Inputter available as the
Reader object 'lines' attribute in the BaseReader.read() function.
- Updates and reorganization of doc-strings and documentation
- Removed the non-working code related to mask support (try again later)
- Added 'meta' and 'keywords' attributes to BaseReader and added a Keywords
class. This is a placeholder for future support of table metadata.
Add support for reading CDS format files (header + data in one file)
Updates to the way lines are processed and comments handled for support of new formats.
- Splitter process_line and process_val and Inputter process_line are now object methods.
This allows for settable parameters that control processing (e.g. continuation_char).
- Add BaseHeader and BaseData process_line methods that do comment and blank-line
filtering as needed. Splitter process_line should no longer be used for this purpose.
- Add support for formats:
- CommentedHeader (column def line begins with comment char)
- Files with continuation lines via ContinuationLinesInputter class
- Add 'Inputter' as an option to get_reader() and read()