nc-gcode-interpreter 0.3.0__tar.gz → 0.3.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.
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/CHANGELOG.md +13 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/Cargo.lock +1 -1
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/Cargo.toml +1 -1
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/PKG-INFO +1 -1
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/__init__.py +11 -9
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_g_group_enum.py +12 -11
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/lib.rs +11 -18
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/.github/workflows/benchmark.yml +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/.github/workflows/build-and-release.yml +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/.gitignore +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/CONTRIBUTING.md +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/Development.md +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/LICENSE +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/README.md +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/TODO.md +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/benches/extensions.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/benches/fixtures.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/benches/workloads.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/build.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/build_backend/nc_build_backend.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/docs/resumable-interpretation-design.md +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/docs/sinumerik-execution-model.md +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/actual_position.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/actual_position.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/arc.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/arc.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/arrays.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/arrays.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/axis_index_assignment.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/axis_index_assignment.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/basic_math.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/basic_math.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/case.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/case.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/case_insensitive_variables.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/case_insensitive_variables.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/custom_vars.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/custom_vars.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/def_string.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/def_string.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/defaults.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/defaults.def +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/defaults.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/defaults_start.json +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/edge_cases.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/edge_cases.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/flattening/flatten_demo.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/flattening/flatten_demo_flattened.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/flattening/flatten_demo_raw.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/for_loop.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/for_loop.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/function_calls.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/function_calls.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/goto.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/goto.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/if_statement.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/if_statement.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/increment.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/increment.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/logic_operators.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/logic_operators.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/loop.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/loop.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/multiple_m_codes.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/multiple_m_codes.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/precedence.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/precedence.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/r_param.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/r_param.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/repeat.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/repeat.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/rot.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/rot.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/simple.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/simple.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/spline.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/spline.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/tool.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/tool.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans2.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans2.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans_ic.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans_ic.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans_reset.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trans_reset.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trig.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/trig.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/variables.csv +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/variables.mpf +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/ggroups/generate_g_commands.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/pyproject.toml +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/example/minimal.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/example/streaming.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/_internal.pyi +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/cli.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/ggroups.json +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/py.typed +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/viz.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/nc_source.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_arithmetic_functions.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_batch_variables.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_batches.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_compare_benchmarks.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_diagnostics.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_expected_output.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_feed_check.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_feed_group.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_field_defects.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_flags.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_flatten.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_frames.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_g_groups.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_g_vocabulary.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_jumps.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_real_comparisons.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_stage1.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_start_inputs.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_streaming.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_string_operations.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_structured_errors.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_subprograms.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_unsupported.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/rustfmt.toml +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/scripts/benchmark.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/scripts/compare_benchmarks.py +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/errors.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/flatten.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/frame.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/grammar.pest +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/interpret_rules.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/interpreter.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/line_driver/experiments.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/line_driver.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/main.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/modal_groups.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/output.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/start.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/state.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/structure_scan.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/subprogram.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/types.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/src/vm.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/tests/cli.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/tests/performance_contract.rs +0 -0
- {nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/uv.lock +0 -0
|
@@ -4,6 +4,19 @@ Notable changes to **nc-gcode-interpreter**. The format loosely follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/); versions are git tags,
|
|
5
5
|
released to PyPI.
|
|
6
6
|
|
|
7
|
+
## [v0.3.1] - 2026-11-11
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- The G-group columns reach Python as one-byte codes and become `pl.Enum`
|
|
12
|
+
by a gather from each group's categories. Before, Rust sent an Arrow
|
|
13
|
+
dictionary tagged with an undocumented polars metadata key, and polars
|
|
14
|
+
looked up every row's string on import. On polars 1.40 a 7M-row program
|
|
15
|
+
with eleven G-group columns takes 15% less CPU (3.92 s to 3.32 s); on
|
|
16
|
+
polars 2.1 the time is unchanged. The output is identical, and the
|
|
17
|
+
interpreter no longer depends on that key. Polars 2 does not cast
|
|
18
|
+
integers to an Enum, so the gather works on both.
|
|
19
|
+
|
|
7
20
|
## [v0.3.0] - 2026-11-11
|
|
8
21
|
|
|
9
22
|
This release changes the API and the output. To upgrade:
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/__init__.py
RENAMED
|
@@ -346,20 +346,22 @@ G_GROUP_DTYPES: dict[str, pl.Enum] = {
|
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
|
|
349
|
+
# Each group's categories as an Enum series; gathering by code builds the column.
|
|
350
|
+
_G_GROUP_CATEGORIES: dict[str, pl.Series] = {
|
|
351
|
+
name: pl.Series(name, dtype.categories, dtype=dtype) for name, dtype in G_GROUP_DTYPES.items()
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
349
355
|
def _batch_frame(batch: Any) -> pl.DataFrame:
|
|
350
356
|
"""Wrap one Arrow batch from Rust, with every G-group column as its Enum.
|
|
351
357
|
|
|
352
|
-
Rust
|
|
353
|
-
|
|
354
|
-
|
|
358
|
+
Rust sends each G-group column as UInt8 indices into the group's commands
|
|
359
|
+
in manual order. Gathering from the Enum's categories turns them into the
|
|
360
|
+
Enum, since polars 2 no longer casts integers to an Enum.
|
|
355
361
|
"""
|
|
356
362
|
frame = pl.DataFrame(batch)
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
for name, dtype in frame.schema.items()
|
|
360
|
-
if name in G_GROUP_DTYPES and dtype != G_GROUP_DTYPES[name]
|
|
361
|
-
]
|
|
362
|
-
return frame.with_columns(casts) if casts else frame
|
|
363
|
+
columns = [_G_GROUP_CATEGORIES[name].gather(frame[name]) for name in frame.columns if name in _G_GROUP_CATEGORIES]
|
|
364
|
+
return frame.with_columns(columns) if columns else frame
|
|
363
365
|
|
|
364
366
|
|
|
365
367
|
def sanitize_dataframe(
|
|
@@ -33,19 +33,20 @@ def test_dtypes_cover_every_group_in_manual_order():
|
|
|
33
33
|
assert G_GROUP_DTYPES["gg01_motion"].categories.to_list()[:4] == ["G0", "G1", "G2", "G3"]
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
def
|
|
37
|
-
# Bypasses _batch_frame:
|
|
36
|
+
def test_g_group_columns_arrive_as_manual_order_codes():
|
|
37
|
+
# Bypasses _batch_frame: Rust hands over UInt8 indices into each group's manual-order list.
|
|
38
38
|
from nc_gcode_interpreter import _internal
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
frames = [pl.DataFrame(batch) for batch in _internal.nc_to_batches(PROGRAM, batch_size=3)]
|
|
41
|
+
raw = pl.concat(frames, how="diagonal")
|
|
42
|
+
expected, _ = nc_to_dataframe(PROGRAM)
|
|
43
|
+
seen = [name for name in raw.columns if name in G_GROUP_DTYPES]
|
|
44
|
+
assert {"gg01_motion", "gg02_wait", "gg06_plane_select"} <= set(seen)
|
|
45
|
+
for name in seen:
|
|
46
|
+
assert raw.schema[name] == pl.UInt8, name
|
|
47
|
+
categories = G_GROUP_DTYPES[name].categories.to_list()
|
|
48
|
+
decoded = [None if code is None else categories[code] for code in raw[name].to_list()]
|
|
49
|
+
assert decoded == expected[name].to_list(), name
|
|
49
50
|
|
|
50
51
|
|
|
51
52
|
def test_batches_share_one_enum_dtype_and_concat_vertically():
|
|
@@ -319,7 +319,7 @@ mod python_bindings {
|
|
|
319
319
|
let mut arrays: Vec<ArrayRef> = Vec::with_capacity(table.columns.len());
|
|
320
320
|
for (name, column) in table.columns {
|
|
321
321
|
if let Some(categories) = crate::modal_groups::g_group_values(&name) {
|
|
322
|
-
let (field, array) =
|
|
322
|
+
let (field, array) = g_group_code_array(&name, categories, column)?;
|
|
323
323
|
fields.push(field);
|
|
324
324
|
arrays.push(array);
|
|
325
325
|
continue;
|
|
@@ -376,30 +376,23 @@ mod python_bindings {
|
|
|
376
376
|
.map_err(|e| PyErr::new::<PyValueError, _>(format!("failed to build RecordBatch: {}", e)))
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
/// One G-group column as
|
|
380
|
-
///
|
|
381
|
-
///
|
|
382
|
-
///
|
|
383
|
-
///
|
|
384
|
-
fn
|
|
379
|
+
/// One G-group column as UInt8 indices into the group's command list in
|
|
380
|
+
/// manual order, which the Python wrapper casts to that group's `pl.Enum`.
|
|
381
|
+
/// Plain codes, because polars imports an Arrow dictionary by looking up
|
|
382
|
+
/// every row's string, about 15 times slower than the integer cast. A value
|
|
383
|
+
/// outside the list is an error, never a null.
|
|
384
|
+
fn g_group_code_array(
|
|
385
385
|
name: &str,
|
|
386
386
|
categories: &'static [&'static str],
|
|
387
387
|
column: Column,
|
|
388
388
|
) -> PyResult<(arrow_schema::Field, arrow_array::ArrayRef)> {
|
|
389
|
-
use arrow_array::
|
|
390
|
-
use
|
|
391
|
-
use arrow_schema::Field;
|
|
389
|
+
use arrow_array::UInt8Array;
|
|
390
|
+
use arrow_schema::{DataType, Field};
|
|
392
391
|
|
|
393
|
-
let
|
|
392
|
+
let codes: UInt8Array = crate::output::g_group_codes(name, categories, &column)
|
|
394
393
|
.map_err(PyErr::new::<PyValueError, _>)?
|
|
395
394
|
.into();
|
|
396
|
-
|
|
397
|
-
let array = DictionaryArray::<UInt8Type>::try_new(keys, Arc::new(values))
|
|
398
|
-
.map_err(|e| PyErr::new::<PyValueError, _>(format!("G-group column '{}': {}", name, e)))?;
|
|
399
|
-
let encoded: String = categories.iter().map(|c| format!("{};{}", c.len(), c)).collect();
|
|
400
|
-
let metadata = HashMap::from([("_PL_ENUM_VALUES2".to_string(), encoded)]);
|
|
401
|
-
let field = Field::new(name, array.data_type().clone(), true).with_metadata(metadata);
|
|
402
|
-
Ok((field, Arc::new(array)))
|
|
395
|
+
Ok((Field::new(name, DataType::UInt8, true), Arc::new(codes)))
|
|
403
396
|
}
|
|
404
397
|
|
|
405
398
|
/// [`table_to_record_batch`] as an [`ArrowBatch`] the Python side receives
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/.github/workflows/build-and-release.yml
RENAMED
|
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
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/docs/resumable-interpretation-design.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/axis_index_assignment.csv
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/axis_index_assignment.mpf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/case_insensitive_variables.csv
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/case_insensitive_variables.mpf
RENAMED
|
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
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/flattening/flatten_demo.mpf
RENAMED
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/examples/flattening/flatten_demo_raw.csv
RENAMED
|
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
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/_internal.pyi
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/cli.py
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/ggroups.json
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/py.typed
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/nc_gcode_interpreter/viz.py
RENAMED
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_arithmetic_functions.py
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_batch_variables.py
RENAMED
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_compare_benchmarks.py
RENAMED
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_expected_output.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_field_defects.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_real_comparisons.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_string_operations.py
RENAMED
|
File without changes
|
{nc_gcode_interpreter-0.3.0 → nc_gcode_interpreter-0.3.1}/python/tests/test_structured_errors.py
RENAMED
|
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
|