From 7787203ed6f072f0678bca40a29363f6c4f00d02 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Fri, 28 Jun 2024 12:00:20 +0200 Subject: [PATCH] DOC: Some rewording and typos. --- CHANGELOG.md | 2 +- src/caosadvancedtools/table_importer.py | 6 +++--- unittests/test_table_importer.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33381f3c..25772147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed ### - The `TableImporter` and its subclasses now change all integer datatypes to the - nullable `pandas.Int64Datatype` s.th. integer columns with empty fields can be + nullable `pandas.Int64Datatype` so that integer columns with empty fields can be treated properly. In case you don't want the datatypes to be changed automatically, initialize the `TableImporter` with `convert_int_to_nullable_int=False`. diff --git a/src/caosadvancedtools/table_importer.py b/src/caosadvancedtools/table_importer.py index 72c7ddd4..5efd0500 100755 --- a/src/caosadvancedtools/table_importer.py +++ b/src/caosadvancedtools/table_importer.py @@ -244,8 +244,8 @@ class TableImporter(): Parameters ---------- converters : dict - Dict with column names as keys and converter functions as values. This dict also defines - what columns are required to exist throught the existing keys. The converter functions are + Dict with column names as keys and converter functions as values. This dict's keys also + define what columns must exist. The converter functions are applied to the cell values. They should also check for ValueErrors, such that a separate value check is not necessary. @@ -267,7 +267,7 @@ class TableImporter(): convert_int_to_nullable_int : bool, optional Whether to convert all integer datatypes to ``pandas.Int64Dtype()`` which is nullable, to allow for integer columns with empty fields. If - set to False, a ``DataInConsistencyError`` will be raised in case of + set to False, a ``DataInconsistencyError`` will be raised in case of empty fields in integer columns. Default is True. """ diff --git a/unittests/test_table_importer.py b/unittests/test_table_importer.py index 92d79334..6d445056 100644 --- a/unittests/test_table_importer.py +++ b/unittests/test_table_importer.py @@ -370,7 +370,7 @@ class CSVImporterTest(TableImporterTest): df = importer_strict.read_file(tmpfile.name) assert "Integer column has NA values in column 1" in str(die.value) - # ... except when a nullable datatype is set explicitly + # ... except when a nullable datatype is set manually beforehand kwargs["datatypes"]["int_with_gaps"] = "Int64" importer_strict = CSVImporter(convert_int_to_nullable_int=False, **kwargs) df = importer_strict.read_file(tmpfile.name) -- GitLab