Skip to content

Commit

Permalink
🎨 linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindee committed Dec 27, 2024
1 parent f4bf2d5 commit ad8ea5d
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/product/business_card_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Business Card V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/business_card_v1.txt
.. literalinclude:: /extras/code_samples/business_card_v1_async.txt
:language: Python

.. autoclass:: mindee.product.business_card.business_card_v1.BusinessCardV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/delivery_note_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Delivery note V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/delivery_notes_v1.txt
.. literalinclude:: /extras/code_samples/delivery_notes_v1_async.txt
:language: Python

.. autoclass:: mindee.product.delivery_note.delivery_note_v1.DeliveryNoteV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/driver_license_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Driver License V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/driver_license_v1.txt
.. literalinclude:: /extras/code_samples/driver_license_v1_async.txt
:language: Python

.. autoclass:: mindee.product.driver_license.driver_license_v1.DriverLicenseV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/financial_document_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Financial Document V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/financial_document_v1.txt
.. literalinclude:: /extras/code_samples/financial_document_v1_async.txt
:language: Python

.. autoclass:: mindee.product.financial_document.financial_document_v1.FinancialDocumentV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/fr/energy_bill_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Energy Bill V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/energy_bill_fra_v1.txt
.. literalinclude:: /extras/code_samples/energy_bill_fra_v1_async.txt
:language: Python

.. autoclass:: mindee.product.fr.energy_bill.energy_bill_v1.EnergyBillV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/fr/health_card_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Health Card V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/french_healthcard_v1.txt
.. literalinclude:: /extras/code_samples/french_healthcard_v1_async.txt
:language: Python

.. autoclass:: mindee.product.fr.health_card.health_card_v1.HealthCardV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/fr/payslip_v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Payslip V2

**Sample Code:**

.. literalinclude:: /extras/code_samples/payslip_fra_v2.txt
.. literalinclude:: /extras/code_samples/payslip_fra_v2_async.txt
:language: Python

.. autoclass:: mindee.product.fr.payslip.payslip_v2.PayslipV2
Expand Down
2 changes: 1 addition & 1 deletion docs/product/fr/payslip_v3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Payslip V3

**Sample Code:**

.. literalinclude:: /extras/code_samples/payslip_fra_v3.txt
.. literalinclude:: /extras/code_samples/payslip_fra_v3_async.txt
:language: Python

.. autoclass:: mindee.product.fr.payslip.payslip_v3.PayslipV3
Expand Down
2 changes: 1 addition & 1 deletion docs/product/invoice_v4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Invoice V4

**Sample Code:**

.. literalinclude:: /extras/code_samples/invoices_v4.txt
.. literalinclude:: /extras/code_samples/invoices_v4_async.txt
:language: Python

.. autoclass:: mindee.product.invoice.invoice_v4.InvoiceV4
Expand Down
2 changes: 1 addition & 1 deletion docs/product/material_certificate_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Material Certificate V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/material_certificate_v1.txt
.. literalinclude:: /extras/code_samples/material_certificate_v1_async.txt
:language: Python

.. autoclass:: mindee.product.material_certificate.material_certificate_v1.MaterialCertificateV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/receipt_v5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Receipt V5

**Sample Code:**

.. literalinclude:: /extras/code_samples/expense_receipts_v5.txt
.. literalinclude:: /extras/code_samples/expense_receipts_v5_async.txt
:language: Python

.. autoclass:: mindee.product.receipt.receipt_v5.ReceiptV5
Expand Down
2 changes: 1 addition & 1 deletion docs/product/resume_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Resume V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/resume_v1.txt
.. literalinclude:: /extras/code_samples/resume_v1_async.txt
:language: Python

.. autoclass:: mindee.product.resume.resume_v1.ResumeV1
Expand Down
2 changes: 1 addition & 1 deletion docs/product/us/healthcare_card_v1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Healthcare Card V1

**Sample Code:**

.. literalinclude:: /extras/code_samples/us_healthcare_cards_v1.txt
.. literalinclude:: /extras/code_samples/us_healthcare_cards_v1_async.txt
:language: Python

.. autoclass:: mindee.product.us.healthcare_card.healthcare_card_v1.HealthcareCardV1
Expand Down
4 changes: 1 addition & 3 deletions mindee/extraction/pdf_extractor/pdf_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ def extract_invoices(
if not isinstance(page_indexes[0], InvoiceSplitterV1PageGroup):
return self.extract_sub_documents(page_indexes) # type: ignore
if not strict:
indexes_as_list = [
page_index.page_indexes for page_index in page_indexes # type: ignore
]
indexes_as_list = [page_index.page_indexes for page_index in page_indexes] # type: ignore
return self.extract_sub_documents(indexes_as_list)
correct_page_indexes: List[List[int]] = []
current_list: List[int] = []
Expand Down
20 changes: 10 additions & 10 deletions tests/product/generated/test_generated_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,13 @@ def test_invoice_v4_complete_doc(invoice_v4_complete_doc) -> None:
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
.values[0]
.product_code
== None
is None
)
assert (
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
.values[0]
.quantity
== None
is None
)
assert (
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
Expand All @@ -505,13 +505,13 @@ def test_invoice_v4_complete_doc(invoice_v4_complete_doc) -> None:
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
.values[0]
.tax_amount
== None
is None
)
assert (
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
.values[0]
.tax_rate
== None
is None
)
assert (
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
Expand All @@ -523,7 +523,7 @@ def test_invoice_v4_complete_doc(invoice_v4_complete_doc) -> None:
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
.values[0]
.unit_price
== None
is None
)
assert (
invoice_v4_complete_doc.inference.prediction.fields["line_items"]
Expand Down Expand Up @@ -705,19 +705,19 @@ def test_invoice_v4_page0(invoice_v4_page_0) -> None:
== "S)BOIE 5X500 FEUILLES A4"
)
assert (
invoice_v4_page_0.prediction.fields["line_items"].values[0].product_code == None
invoice_v4_page_0.prediction.fields["line_items"].values[0].product_code is None
)
assert invoice_v4_page_0.prediction.fields["line_items"].values[0].quantity == None
assert invoice_v4_page_0.prediction.fields["line_items"].values[0].quantity is None
assert (
invoice_v4_page_0.prediction.fields["line_items"].values[0].tax_amount == None
invoice_v4_page_0.prediction.fields["line_items"].values[0].tax_amount is None
)
assert invoice_v4_page_0.prediction.fields["line_items"].values[0].tax_rate == None
assert invoice_v4_page_0.prediction.fields["line_items"].values[0].tax_rate is None
assert (
invoice_v4_page_0.prediction.fields["line_items"].values[0].total_amount
== "2.63"
)
assert (
invoice_v4_page_0.prediction.fields["line_items"].values[0].unit_price == None
invoice_v4_page_0.prediction.fields["line_items"].values[0].unit_price is None
)

assert isinstance(
Expand Down

0 comments on commit ad8ea5d

Please sign in to comment.