Comments (4)
Thanks for reporting the issue.
Would it be worth putting a warning about this in section 1.2 of the documentation just in case?
Would you mind sharing a CSV that fails? The best option may be to correct this behavior.
from d47crunch.
I should have mentioned that it depends on the ordering of the columns as to whether or not it fails...
If you take the rawdata.csv
example file and re-order the columns so that any column other than UID
or Session
is first, then save as a .csv in UTF-8 encoding from the spreadsheet program, it fails with a KeyError: 'Sample'
on line for s in sorted({r['Sample'] for r in self})
when self.refresh_samples()
is called (or another such key error).
I think this is because the spreadsheet program puts a UTF-8 byte order mark (BOM) at the start of the file, so D47crunch can't find the column headings it expects to see.
from d47crunch.
In that case, the best case scenario is that another field gets a spurious BOM in its name, which is likely to cause cryptic problems down the line. If you send me an example file I can try to debug.
The longer-term solution, of course, it to use a more robust csv parsing implementation. There are probably many out there.
On the other hand, you could argue that producing clean csv files is Excel's job, not D47crunch's. Implementing corrective measures in every library likely to encounter this format is expensive. Converting “quasi-CSV” to ”bare-CSV” between Excel and these libraries would probably be less expensive. YMMV.
from d47crunch.
I agree 100% that it is an Excel problem not a D47crunch problem... I just thought it might be discouraging for a relatively new python user trying to get their D47crunch / D47calib script working.
A simple error msg informing the user that they need to clean up their filthy csv file could do the job?
See file attached:
rawdata_dirty.csv
from d47crunch.
Related Issues (15)
- decide on how to make plotting interfaces consistent HOT 5
- add a **see also** section to readme HOT 2
- clumpycrunch formatting
- issue with trying to set parameter b to 0 in standardize(constraints = ...) call HOT 7
- D47crunch name HOT 2
- missing depency: rich? HOT 1
- Output temperature in Table of Samples? HOT 2
- `indep_sessions` standardization is not working HOT 1
- Update module-level table functions for Δ49
- Implementation of Δ48 standardization HOT 6
- crunch throws an error with failed d45 type HOT 11
- standardize throws an error because of package lmfit HOT 5
- Improve `plot_distribution_of_analyses` or throw warnings in case there are many sessions/samples HOT 7
- `standardize` is slow with large datasets HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d47crunch.