data-sampler 3.5.0__tar.gz → 3.5.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.
Files changed (46) hide show
  1. {data_sampler-3.5.0 → data_sampler-3.5.1}/CHANGELOG.md +11 -0
  2. {data_sampler-3.5.0 → data_sampler-3.5.1}/PKG-INFO +1 -1
  3. {data_sampler-3.5.0 → data_sampler-3.5.1}/pyproject.toml +1 -1
  4. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/__init__.py +1 -1
  5. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/tui/app.py +6 -0
  6. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_tui.py +25 -0
  7. {data_sampler-3.5.0 → data_sampler-3.5.1}/.gitattributes +0 -0
  8. {data_sampler-3.5.0 → data_sampler-3.5.1}/.github/workflows/release.yml +0 -0
  9. {data_sampler-3.5.0 → data_sampler-3.5.1}/.gitignore +0 -0
  10. {data_sampler-3.5.0 → data_sampler-3.5.1}/LICENSE +0 -0
  11. {data_sampler-3.5.0 → data_sampler-3.5.1}/README.md +0 -0
  12. {data_sampler-3.5.0 → data_sampler-3.5.1}/ROADMAP.md +0 -0
  13. {data_sampler-3.5.0 → data_sampler-3.5.1}/docs/RELEASING.md +0 -0
  14. {data_sampler-3.5.0 → data_sampler-3.5.1}/docs/TROUBLESHOOTING.md +0 -0
  15. {data_sampler-3.5.0 → data_sampler-3.5.1}/docs/img/tui-columns.png +0 -0
  16. {data_sampler-3.5.0 → data_sampler-3.5.1}/docs/img/tui-file.png +0 -0
  17. {data_sampler-3.5.0 → data_sampler-3.5.1}/docs/img/tui-report.png +0 -0
  18. {data_sampler-3.5.0 → data_sampler-3.5.1}/examples/employees.csv +0 -0
  19. {data_sampler-3.5.0 → data_sampler-3.5.1}/examples/using_data_sampler.ipynb +0 -0
  20. {data_sampler-3.5.0 → data_sampler-3.5.1}/requirements.txt +0 -0
  21. {data_sampler-3.5.0 → data_sampler-3.5.1}/scripts/run-tui.bat +0 -0
  22. {data_sampler-3.5.0 → data_sampler-3.5.1}/scripts/run-tui.sh +0 -0
  23. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/__main__.py +0 -0
  24. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/_logging.py +0 -0
  25. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/_names.py +0 -0
  26. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/anonymize.py +0 -0
  27. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/cli.py +0 -0
  28. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/engine.py +0 -0
  29. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/io.py +0 -0
  30. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/reduce.py +0 -0
  31. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/report.py +0 -0
  32. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/sampling.py +0 -0
  33. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/stats.py +0 -0
  34. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/tui/__init__.py +0 -0
  35. {data_sampler-3.5.0 → data_sampler-3.5.1}/src/data_sampler/workflow.py +0 -0
  36. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/conftest.py +0 -0
  37. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_anonymize.py +0 -0
  38. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_cli.py +0 -0
  39. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_engine.py +0 -0
  40. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_io.py +0 -0
  41. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_names.py +0 -0
  42. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_reduce.py +0 -0
  43. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_report.py +0 -0
  44. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_sampling.py +0 -0
  45. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_stats.py +0 -0
  46. {data_sampler-3.5.0 → data_sampler-3.5.1}/tests/test_workflow.py +0 -0
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## v3.5.1 — 2026-07-24
4
+
5
+ - **The "skip from reduction (PCA)" toggle is hidden for non-numeric columns.**
6
+ PCA reduction only ever operates on continuous numeric columns (booleans and
7
+ datetimes are explicitly rejected; strings/categoricals never qualify), so the
8
+ toggle is meaningless on those columns. It now appears in the detail panel only
9
+ when the selected column is numeric — matching the columns table, which already
10
+ renders `—` in the reduce cell for non-numeric columns. No behavior change to
11
+ the reduction itself: skipped columns were, and remain, held out of the PCA
12
+ math entirely and passed through to the output unchanged.
13
+
3
14
  ## v3.5.0 — 2026-07-24
4
15
 
5
16
  - **Names anonymizer is now gender- and ethnicity-aware.** The bundled library
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: data-sampler
3
- Version: 3.5.0
3
+ Version: 3.5.1
4
4
  Summary: Hand someone data that looks and behaves like your production data, isn't your production data, and provably kept its statistical variety — stratified sampling + consistent anonymization, with a terminal UI.
5
5
  Project-URL: Homepage, https://github.com/aaronified/data-sampler
6
6
  Project-URL: Changelog, https://github.com/aaronified/data-sampler/blob/main/CHANGELOG.md
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "data-sampler"
7
- version = "3.5.0"
7
+ version = "3.5.1"
8
8
  description = "Hand someone data that looks and behaves like your production data, isn't your production data, and provably kept its statistical variety — stratified sampling + consistent anonymization, with a terminal UI."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -18,7 +18,7 @@ Public API::
18
18
 
19
19
  from __future__ import annotations
20
20
 
21
- __version__ = "3.5.0"
21
+ __version__ = "3.5.1"
22
22
 
23
23
  from .io import SUPPORTED_EXTENSIONS, list_sheets, load_file, save_output
24
24
  from .reduce import ReductionResult, reduce_columns
@@ -882,6 +882,12 @@ class ColumnsScreen(Screen):
882
882
  skip_reduce = self.query_one("#skip-reduce", Switch)
883
883
  if skip_reduce.value != cfg.skip_reduce:
884
884
  skip_reduce.value = cfg.skip_reduce
885
+ # PCA reduction only ever touches continuous numeric columns, so the
886
+ # "skip from reduction" toggle is meaningless for string / categorical
887
+ # / boolean / datetime columns — hide the whole row for those
888
+ self.query_one("#reduce-skip-row").set_class(
889
+ self.stats[name].kind != "numeric", "hidden"
890
+ )
885
891
  # names gender / ethnicity controls
886
892
  gsel = self.query_one("#opt-names-gender", Select)
887
893
  if gsel.value != cfg.gender:
@@ -584,6 +584,31 @@ def test_non_numeric_skip_reduce_shows_dash(csv_file):
584
584
  run(go())
585
585
 
586
586
 
587
+ def test_reduce_skip_toggle_hidden_for_non_numeric(csv_file):
588
+ """PCA reduction only ever touches continuous numeric columns, so the
589
+ 'skip from reduction (PCA)' row must be shown for numeric columns and
590
+ hidden for string / categorical / boolean columns."""
591
+ async def go():
592
+ app = DataSamplerApp(path=str(csv_file))
593
+ async with app.run_test(size=(160, 45)) as pilot:
594
+ screen = await wait_for_screen(app, pilot, ColumnsScreen)
595
+ row = screen.query_one("#reduce-skip-row")
596
+
597
+ screen._sync_config_panel("score") # numeric → shown
598
+ assert not row.has_class("hidden")
599
+
600
+ screen._sync_config_panel("region") # categorical → hidden
601
+ assert row.has_class("hidden")
602
+
603
+ screen._sync_config_panel("active") # boolean → hidden
604
+ assert row.has_class("hidden")
605
+
606
+ screen._sync_config_panel("id") # numeric again → shown
607
+ assert not row.has_class("hidden")
608
+
609
+ run(go())
610
+
611
+
587
612
  def test_refresh_browser_action(csv_file):
588
613
  async def go():
589
614
  app = DataSamplerApp()
File without changes
File without changes
File without changes
File without changes