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

DEP: PEP8 renaming #900

Merged
merged 13 commits into from
May 26, 2022
Merged

DEP: PEP8 renaming #900

merged 13 commits into from
May 26, 2022

Conversation

MartinThoma
Copy link
Member

@MartinThoma MartinThoma commented May 25, 2022

PyPDF2 interface changes:

  • getXmpMetadata / xmpMetadata ➔ xmp_metadata
  • get_outlines ➔ _get_outlines (use outlines property instead)
  • getXmpMetadata ➔ xmp_metadata
  • getDestArray ➔ dest_array
  • additionalActions ➔ additional_actions
  • defaultValue ➔ default_value
  • mappingName ➔ mapping_name
  • altName ➔ alternate_name
  • fieldType ➔ field_type
  • ensureIsNumber ➔ _ensure_is_number
  • decodedSelf : decoded_self
  • addChild / removeChild ➔ add_child / remove_child
  • flateEncode ➔ flate_encode
  • getData / setData ➔ get_data / set_data

DOC: Use the new PyPDF2 interface
STY: Use reader/writer as variable names for PdfReader / PdfWriter

* getXmpMetadata / xmpMetadata
@MartinThoma MartinThoma marked this pull request as draft May 25, 2022 18:35
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #900 (81e99e6) into main (e8513e7) will decrease coverage by 0.65%.
The diff coverage is 68.37%.

@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
- Coverage   78.55%   77.90%   -0.66%     
==========================================
  Files          16       16              
  Lines        4258     4317      +59     
  Branches      813      813              
==========================================
+ Hits         3345     3363      +18     
- Misses        738      780      +42     
+ Partials      175      174       -1     
Impacted Files Coverage Δ
PyPDF2/xmp.py 52.06% <50.00%> (-1.04%) ⬇️
PyPDF2/generic.py 77.97% <61.53%> (-1.90%) ⬇️
PyPDF2/_reader.py 77.17% <88.88%> (-0.72%) ⬇️
PyPDF2/_merger.py 65.51% <100.00%> (-0.33%) ⬇️
PyPDF2/_page.py 79.23% <100.00%> (ø)
PyPDF2/_writer.py 78.90% <100.00%> (ø)
PyPDF2/filters.py 75.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e8513e7...81e99e6. Read the comment docs.

@MartinThoma
Copy link
Member Author

MartinThoma commented May 25, 2022

@MartinThoma
Copy link
Member Author

MartinThoma commented May 25, 2022

rotate_clockwise -> just rotate?

Pro rotate_clockwise:

  • It's clear from the name in which direction the rotation goes

Pro rotate:

Other:

  • OpenCV: cv2.rotate(src, cv2.cv2.ROTATE_90_CLOCKWISE)
  • Nump: rot90(m, k)

@MartinThoma MartinThoma marked this pull request as ready for review May 26, 2022 07:56
@MartinThoma MartinThoma merged commit 787c784 into main May 26, 2022
@MartinThoma MartinThoma deleted the pep8-renamings-xmp-metadata branch May 26, 2022 09:02
MartinThoma added a commit that referenced this pull request May 26, 2022
* getXmpMetadata / xmpMetadata ➔ xmp_metadata
* get_outlines ➔ _get_outlines (use outlines property instead)
* getXmpMetadata ➔ xmp_metadata
* getDestArray ➔ dest_array
* additionalActions ➔ additional_actions
* defaultValue ➔ default_value
* mappingName ➔ mapping_name
* altName ➔ alternate_name
* fieldType ➔ field_type
* ensureIsNumber ➔ _ensure_is_number
* decodedSelf : decoded_self
* addChild / removeChild  ➔ add_child / remove_child
* flateEncode  ➔ flate_encode
* getData / setData  ➔ get_data / set_data

See #900
@MartinThoma MartinThoma mentioned this pull request May 26, 2022
MartinThoma added a commit that referenced this pull request May 26, 2022
* getXmpMetadata / xmpMetadata ➔ xmp_metadata
* get_outlines ➔ _get_outlines (use outlines property instead)
* getXmpMetadata ➔ xmp_metadata
* getDestArray ➔ dest_array
* additionalActions ➔ additional_actions
* defaultValue ➔ default_value
* mappingName ➔ mapping_name
* altName ➔ alternate_name
* fieldType ➔ field_type
* ensureIsNumber ➔ _ensure_is_number
* decodedSelf : decoded_self
* addChild / removeChild  ➔ add_child / remove_child
* flateEncode  ➔ flate_encode
* getData / setData  ➔ get_data / set_data

See #900
MartinThoma added a commit that referenced this pull request May 26, 2022
* getXmpMetadata / xmpMetadata ➔ xmp_metadata
* get_outlines ➔ _get_outlines (use outlines property instead)
* getXmpMetadata ➔ xmp_metadata
* getDestArray ➔ dest_array
* additionalActions ➔ additional_actions
* defaultValue ➔ default_value
* mappingName ➔ mapping_name
* altName ➔ alternate_name
* fieldType ➔ field_type
* ensureIsNumber ➔ _ensure_is_number
* decodedSelf : decoded_self
* addChild / removeChild  ➔ add_child / remove_child
* flateEncode  ➔ flate_encode
* getData / setData  ➔ get_data / set_data

See #900
MartinThoma added a commit that referenced this pull request May 26, 2022
* getXmpMetadata / xmpMetadata ➔ xmp_metadata
* get_outlines ➔ _get_outlines (use outlines property instead)
* getXmpMetadata ➔ xmp_metadata
* getDestArray ➔ dest_array
* additionalActions ➔ additional_actions
* defaultValue ➔ default_value
* mappingName ➔ mapping_name
* altName ➔ alternate_name
* fieldType ➔ field_type
* ensureIsNumber ➔ _ensure_is_number
* decodedSelf : decoded_self
* addChild / removeChild  ➔ add_child / remove_child
* flateEncode  ➔ flate_encode
* getData / setData  ➔ get_data / set_data

See #900
MartinThoma added a commit that referenced this pull request May 26, 2022
PdfReader: 
* getXmpMetadata / xmpMetadata ➔ xmp_metadata
* get_outlines ➔ _get_outlines (use outlines property instead)

Field attributes:
* additionalActions ➔ additional_actions
* defaultValue ➔ default_value
* mappingName ➔ mapping_name
* altName ➔ alternate_name
* fieldType ➔ field_type

StreamObject: 
* decodedSelf : decoded_self
* flateEncode  ➔ flate_encode

Other:

* Destination: getDestArray ➔ dest_array
* RectangleObject: ensureIsNumber ➔ _ensure_is_number
* TreeObject: addChild / removeChild  ➔ add_child / remove_child
* DecodedStreamObject: getData / setData  ➔ get_data / set_data

See #900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants