deprecate: Deprecate function in ProfileParser and deprecate PDFParser#171
deprecate: Deprecate function in ProfileParser and deprecate PDFParser#171cadenmyers13 wants to merge 20 commits intodiffpy:v3.3.0from
ProfileParser and deprecate PDFParser#171Conversation
…Data, and getMetaData
| - For files with 3 columns: assumes (x, y, dy) and sets dx to 0. | ||
| - For files with 4 columns: assumes (x, y, dx, dy). | ||
| - For other cases: `column_format` must be explicitly specified. | ||
|
|
There was a problem hiding this comment.
Here in the docstring describes the default behavior, users can change this depending on their data format
|
@sbillinge ready for review. It looks like precommit is failing because of some python 3.14 thing |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v3.3.0 #171 +/- ##
==========================================
+ Coverage 78.60% 78.89% +0.29%
==========================================
Files 24 25 +1
Lines 3734 3786 +52
==========================================
+ Hits 2935 2987 +52
Misses 799 799
🚀 New features to boost your workflow:
|
|
@sbillinge I figured out the pre-commit issue. its failing because - repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
hooks:
- id: docformatter
language_version: python3.13
additional_dependencies: [tomli]
args: [--in-place, --config, ./pyproject.toml]
This will have to be removed in the future or we can just let pre-commit fail for now until docformatter is up to 3.14 standards. It fails because some |
As I was working on deprecation, I felt as if we could centralize the
parserto one place and useload_datafromdiffpy.utilsinstead of having separate parsers.The
PDFParserwas designed for older data formats too so it doesn't capture as much info as shown here:PDFParser metadata: for data.gr
ProfileParser metadata: for data.gr
The work here deprecates
PDFParserin favor ofProfileParser, a more general approach to parsing data. I've included tests for this too. This also centralizes some parsing functionality which will hopefully make it easier to dev on and easier for users. Im open to discussion if you'd prefer a different route though.From what i inferred from the code, it seems like
ProfileParserwas designed so people can build their own parsers for their specific data formats andPDFParseris one example that does this.