dataframe-toolkit 0.17.0__tar.gz → 0.17.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/PKG-INFO +1 -1
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/pyproject.toml +1 -1
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/pyproject.toml.orig +1 -1
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/io.py +30 -13
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/skills/dftk/SKILL.md +2 -1
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/README.md +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/__init__.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/cli.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/__init__.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/annotate_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/append_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/base.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/binx_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/chi_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/clean_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/cleannames_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/concat_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/corr_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/dataset_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/describe_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/eval_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/explode_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/fit_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/func_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/heatmap_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/help.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/hist_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/implode_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/info_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/interp_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/line_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/melt_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/merge_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/pairs_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/pivot_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/print_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/query_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/randvar_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/sample_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/scale_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/scat_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/segid_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/skill_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/split_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/stat_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/test_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/transpose_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/commands/wstat_cmd.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/__init__.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/copula.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/docformats.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/evalfuncs.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/plot.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/seed.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/seq.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/common/stats.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/io.py +0 -0
- {dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/skills/dftk/references/snakemake.md +0 -0
|
@@ -645,14 +645,16 @@ class io:
|
|
|
645
645
|
sort_group = g.add_mutually_exclusive_group()
|
|
646
646
|
sort_group.add_argument(
|
|
647
647
|
"--sortasc",
|
|
648
|
-
help="Sort ascending by named columns
|
|
648
|
+
help="Sort ascending by the named columns; without names, by "
|
|
649
|
+
"every column, left to right.",
|
|
649
650
|
nargs="*",
|
|
650
651
|
default=None,
|
|
651
652
|
metavar="COL",
|
|
652
653
|
)
|
|
653
654
|
sort_group.add_argument(
|
|
654
655
|
"--sortdesc",
|
|
655
|
-
help="Sort descending by named columns
|
|
656
|
+
help="Sort descending by the named columns; without names, by "
|
|
657
|
+
"every column, left to right.",
|
|
656
658
|
nargs="*",
|
|
657
659
|
default=None,
|
|
658
660
|
metavar="COL",
|
|
@@ -757,24 +759,39 @@ class io:
|
|
|
757
759
|
except Exception:
|
|
758
760
|
logging.warning(f"--cast: failed for {item!r}")
|
|
759
761
|
|
|
760
|
-
# Sort
|
|
762
|
+
# Sort; --sortasc or --sortdesc without names sorts by every column,
|
|
763
|
+
# left to right
|
|
761
764
|
sortcols: list[str] = []
|
|
762
765
|
sortdirs: list[bool] = []
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
766
|
+
for option, ascending in (("sortasc", True), ("sortdesc", False)):
|
|
767
|
+
names = getattr(args, option, None)
|
|
768
|
+
if names is not None:
|
|
769
|
+
names = names or list(df.columns)
|
|
770
|
+
sortcols += names
|
|
771
|
+
sortdirs += [ascending] * len(names)
|
|
769
772
|
for item in getattr(args, "sort", None) or []:
|
|
770
|
-
col, direction = item.
|
|
773
|
+
col, sep, direction = item.rpartition(":")
|
|
774
|
+
if not sep or direction.lower() not in ("a", "d"):
|
|
775
|
+
raise ValueError(f"--sort expects COL:a or COL:d, got {item!r}")
|
|
771
776
|
sortcols.append(col)
|
|
772
|
-
sortdirs.append(direction.lower()
|
|
777
|
+
sortdirs.append(direction.lower() == "a")
|
|
773
778
|
if sortcols:
|
|
779
|
+
missing = [c for c in sortcols if c not in df.columns]
|
|
780
|
+
if missing:
|
|
781
|
+
hint = ""
|
|
782
|
+
if any(os.path.exists(c) for c in missing):
|
|
783
|
+
hint = (
|
|
784
|
+
" A file name was read as a column: put the file "
|
|
785
|
+
"before --sortasc/--sortdesc, or end the list with --"
|
|
786
|
+
)
|
|
787
|
+
raise ValueError(
|
|
788
|
+
f"--sort: column(s) not found: {missing}. Available "
|
|
789
|
+
f"columns: {list(df.columns)}.{hint}"
|
|
790
|
+
)
|
|
774
791
|
try:
|
|
775
792
|
df = df.sort_values(by=sortcols, ascending=sortdirs)
|
|
776
|
-
except
|
|
777
|
-
|
|
793
|
+
except TypeError as exc: # e.g. numbers and text in one column
|
|
794
|
+
raise ValueError(f"--sort failed on {sortcols}: {exc}") from exc
|
|
778
795
|
|
|
779
796
|
# Drop columns
|
|
780
797
|
for pattern in getattr(args, "drop", None) or []:
|
|
@@ -82,7 +82,8 @@ Input: `--prequery EXPR` (filter rows right after reading), `--noheader`
|
|
|
82
82
|
Output, applied after the command's own work: `--select COL… [+]` (choose
|
|
83
83
|
and order columns; globs allowed; a trailing `+` keeps the remaining
|
|
84
84
|
columns), `--drop COL…`, `--move OLD:NEW…` (rename), `--postquery EXPR`,
|
|
85
|
-
`--sortasc COL
|
|
85
|
+
`--sortasc [COL…]` / `--sortdesc [COL…]` (no names: every column, left to
|
|
86
|
+
right; give the file before them) / `--sort COL:a COL:d`,
|
|
86
87
|
`--round COL:N`, `--digits N`, `--cast COL:TYPE`, `--deduplicate [COL…]`,
|
|
87
88
|
`--dropna`, `--na_rep VAL`, `--removeheader`, and
|
|
88
89
|
`--meta KEY=VALUE` (provenance, see below).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dataframe_toolkit-0.17.0 → dataframe_toolkit-0.17.1}/src/dftk/skills/dftk/references/snakemake.md
RENAMED
|
File without changes
|