Releases: hannahdiels/pytil
v8.0.5
v8.0.1
Only a small internal change.
v8.0.0
Backwards incompatible changes:
-
Remove
.data_frame.split_array_like: use upstreamdf.explode
instead. -
Rename
.data_frame.equalsto.data_frame.df_equals. -
Rename
.data_frame.assert_equalsto.data_frame.assert_df_equals. -
Rename
.series.equalsto.series.series_equals. -
Rename
.series.assert_equalsto.series.assert_series_equals. -
Remove
.series.split: use upstreamseries.explodeinstead. -
Remove
.data_frame.replace_na_with_none: float columns would become the
less efficient dtype=object if you used None instead of nan. While
bool(np.nan) != bool(None), you can usepd.isna(value)and
pd.notna. In cases where None/np.nan do cause trouble downstream you
could make things consistent by replacing None with nan
df.fillna(np.nan)though likely you'll prefer some value more specific
to what you're doing e.g.df.replace(np.nan, ''); which replaces any NA
value, including None. -
Remove
.logging.configure: too project specific. Use logging directly
instead. -
Remove
.logging.set_level: only 1 or so project still uses this, just
inline it into the project. -
Remove
.test.reset_loggers: either mock anything that configures logging
or when testing a CLI, call it in a subprocess. It might not be a problem
anymore with today's pytest caplog. -
Remove some
.test.assert*. Usually the default pytest reporting for
these is good enough when straight up usingassert. If you do want
different reporting it would be better to define
pytest_assertrepr_compareinstead.-
Remove
assert_text_equals: useassert actual == expected -
Remove
assert_text_contains(whole, part):
useassert part in whole -
Remove
assert_matches(actual, pattern, flags=0):
useassert re.match(pattern, actual, flags) -
Remove
assert_search_matches(actual, pattern, flags=0):
useassert re.search(pattern, actual, flags) -
Remove
assert_lines_equal:
useassert tuple(actual) == tuple(expected)
-
-
Remove
.test.assert_dir_equals: too project specific / inflexible, e.g.
do you care about line order in files or just want hashes to match...
better to compare the contents yourself as then you can pick the right
assert for ways to compare files. Copy it to your project instead. -
Remove
.test.assert_file_mode: too project specific. Copy it instead. -
Remove
.test.assert_file_equals: too project specific. Copy it instead. -
Remove
.algorithms.multiway_partitions: copy it instead. -
Remove
.algorithms.toset_from_tosets: copy it instead. -
Remove
.click.optionand.click.password_option: too project
specific. Copy it instead. -
Remove
.configuration.ConfigurationLoader: most projects can make do
with pyxdg'sload_first_config, so no inheritance and the config does
not provide defaults for the CLI. If you do need this, you can probably
find a different library that does something similar or copy the old code. -
Remove
.debug.pretty_memory_info: can probably be found in some other
library or use a proper memory profiler. -
Remove
.dict.pretty_print_head: too trivial, copy it instead. -
Remove
.dict.DefaultDict: probably can be found elsewhere. -
Remove
.dict.invert: might find it in some other library, probably
better redesign your algorithm to avoid needing this in the first place. -
Remove
.multi_dict.MultiDict: can be found in other libraries. -
Remove
.difflib.line_diff: too project specific, copy it if you need
that specific behaviour or use difflib directly or find a 3rd party
library. -
Remove
.exceptions.exc_info: too trivial, copy it into your project if
needed -
Remove
.exceptions.UserException: too project specific. -
Remove
.exceptions.InvalidOperationError: too project specific. -
Remove
.hashlib.base85_digest: too trivial, just copy it. -
Remove
.iterable.is_sorted: surely this already exists in
more_itertools, toolz.itertoolz or something. -
Rename
.numpyto.typing -
Remove
.parse.tsv,.parse.csv: too project specific, copy it. -
Remove
.path.sorted_lines: too project specific, copy it. -
Remove
.sqlalchemy.log_sql: too trivial, copy it. -
Remove
.sqlalchemy.pretty_sql: too trivial, copy it. -
Remove
.write.tsv,.write.csv: too project specific, copy it. -
Rename
.various.join_multilineto.various.join_lines -
Remove
.pkg_resources.resource_path: Replace with importlib.resources.path instead. For python<3.7, first install importlib_resources. -
Remove
.pkg_resources.resource_copy: this broke on python 3.8 (or
earlier), it could be reimplemented with importlib.resources or better yet
you could store a zip/tgz to avoid needing to copy a dir. -
Rename
.test.assert_xlsx_equalsto.xlsx_compare.assert_xlsx_equals -
Rename
.test.assert_xml_equalsto.xml_compare.assert_xml_equals
8.0.0.dev3: Publish when release is published
Ignore this. Testing the github workflow.
8.0.0.dev2
Ignore this, just trying out the new github workflow
8.0.0.dev
Removed functions which can be found elsewhere, see changelog; and package for conda instead of pypi
7.0.0
-
Backwards incompatible changes:
-
Remove
path.tsv_lines: useparse.tsvinstead. -
Remove
algorithms.spread_points_in_hypercube: it simply returned opints
on a grid, which can be achieved with numpy.meshgrid, e.g. 3D grid:import numpy as np side = np.linspace(0, 1, ceil(n**(1/3))) points = np.array(np.meshgrid(side, side, side)).reshape(3,-1).T -
Rename
path.assert_modetotest.assert_file_mode -
Rename
path.assert_equalstotest.assert_file_equals
-
-
Enhancements/additions:
- Add
test.assert_dir_equals - Add
various.join_multiline - Add
test.assert_xlsx_equals - Add
parse.csv - Add
parse.tsv - Add
write.csv - Add
write.tsv
- Add
6.0.0
-
Backwards incompatible changes:
-
Remove
asyncio.stubborn_gather: More often than not, when you need this,
you should look into a full blown pipeline framework such as Nextflow
instead. -
Remove
click.assert_runs: It is usually simpler to use pytest's
isolation and output capturing than to use this function -
Remove
click.argument: Click's arguments are required by default, you
can simply use the real click.argument directly. -
Remove
dict.assign: Esoteric and easily replaced by:destination.clear(); destination.update(source). -
Remove
function.compose: Compose can be found in other PyPI packages,
e.g. in Toolz:toolz.functoolz.compose. -
Remove
http.download:urllib.request.urlretrievecan be used instead,
though the filename suggested by the server is not used. Only the extension of
the downloaded file will match that of the server. -
Remove
inspect.call_args: Esoteric, can achieve something very
similar with:args = inspect.signature(f).bind_partial(*args, **kwargs) args.apply_defaults() dict(args.arguments) -
Remove
iterable.sliding_window: Usemore_itertools.windowedinstead.
Drop in replacement. -
Remove
iterable.partition: If your data is sorted by key, you can just
useitertools.groupbyas drop in replacement. Else, you can use
toolz.itertoolz.groupby, but arg order is swapped and element order may not be
preserved. -
Remove
iterable.flatten: Usemore_itertools.collapseinstead.
flatten(a, b)becomescollapse(a, levels=b). -
Remove
path.write: Usepathlib.Path.write_textinstead. However, you
are now responsible for creating any missing ancestor directories
(os.makedirs). The use of mode can be replaced byp.touch(); p.chmod(mode); p.write_text()or a variation depending on your use case. -
Remove
path.read: Usepathlib.Path.read_textinstead. -
Remove
pymysql.patch: Instead of globally patching it, use theconv
argument when creating a pymysql Connection. -
algorithms.multi_way_partitioningnow returns a frozenbag instead of a bag. -
multi_dict.MultiDict.invertnow returns a MultiDict instead of a dict.
-
-
Enhancements/additions:
- Add
difflib.line_diff - Add
numpy.ArrayLike - Add
path.TemporaryDirectory - Add
path.is_descendant - Add
path.is_descendant_or_self - Add
path.sorted_lines - Add
path.tsv_lines - Add
pkg_resources.resource_copy - Add
test.assert_dir_unchanged - Add
test.assert_lines_equal - Add
test.assert_xml_equals - Add
test.reset_loggers test.assert_text_equals: Show diff when not equal
- Add
-
Fixes:
- Fix package: Add missing data files and dependencies
- Fix formatting of
test.assert_matches,test.assert_search_matches:
forgot newline afterActual:
5.0.0
Major backwards incompatible change: Renamed root package, pypi name and
project to pytil.
4.1.2
Announce rename from chicken turtle util to pytil.