Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write reader and writer for common format as csv and xls #97

Open
fernandezc opened this issue Jun 5, 2020 · 3 comments
Open

write reader and writer for common format as csv and xls #97

fernandezc opened this issue Jun 5, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@fernandezc
Copy link
Collaborator

fernandezc commented Jun 5, 2020

We need to export to tabulated format (csv, xls... ) or to export form these formats. Other formats could also be interesting.

Solution:
Instead of writing completely new module, we can take advantage that Pandas is already present in the required package and write some wrappers to the function present in this library:
https://pandas.pydata.org/pandas-docs/stable/reference/io.html

@fernandezc fernandezc added the enhancement New feature or request label Jun 5, 2020
@fernandezc fernandezc added this to the 0.1.21 milestone Jun 5, 2020
@fernandezc fernandezc changed the title write reader and writer for common format as cdv and xls write reader and writer for common format as csv and xls Jun 5, 2020
@fernandezc
Copy link
Collaborator Author

fernandezc commented Jun 5, 2020

By the way, In the next upcoming commit I will suppress the dependence to xlrd (used in only one orphan util file)

@fernandezc
Copy link
Collaborator Author

fernandezc commented Jun 5, 2020

ooups correction! xlrd is used in read_carrousel.

May be we could look if we cannot use pandas instead to avoid importing additional librairies? @atravert

@atravert
Copy link
Collaborator

atravert commented Jun 5, 2020

Yes. but i can change it for the panda reader.

when i think about this issue, the main "difficulty" we will have is to define where/how to write the data and maybe the meta data. Because these methods will be mostly used to read/export from/to third party applications that will all have specific requirements

For instance in csv/excel:

  • 1D, 2D: col1=xcoord, col2 ... = data ; but depending on applications, line1 contains a tittl or is the 1st coord and the corresponding data
  • 3D: it can be one csv file (or excel sheet) per 'z' élement , but where to store the z coord ?

And in any case where to store the other meta data ? in excel: on a specific sheet ; in csv: on a specific file ? or on the first lines of the csv ? , but then it will be less readable by 3d party apps.

For the, reading, the main difficulty is that the locations of data and metadata and th eformats will change a lot depending on the applications, and on the version of the apps, etc... So for the reader part, I was actually wondering if it is worth wrapping existing libraries for reading - that will probably lead to less flexibility ?, instead of using directly pandas ?

On a closely related subject: you mentioned the CSDM developped by D. Massiot et al. It would be also interesting to look at the open netCDF format (also used by xarray) , which is binary and widely used (though not much in chemistry). Before writing routines to read/write csv of excel to/from Spectrochempy , it could be interesting to see which are the current solutions adopted to convert netCDF to/from csv or excel ? ;

@fernandezc fernandezc modified the milestones: 0.1.21, 0.2 Jun 23, 2020
@fernandezc fernandezc modified the milestones: 0.2, 0.2.1 Jan 8, 2021
@fernandezc fernandezc modified the milestones: 0.2.2, 0.2.3, 0.2.4, 0.2.5 Jan 22, 2021
@fernandezc fernandezc modified the milestones: 0.2.5, 0.2.6, 0.3.0 Jan 29, 2021
@fernandezc fernandezc removed this from the 0.3.0 milestone Jan 20, 2022
This was referenced Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants