cpp-pd-code-simplify-interface 0.1.4__py3-none-any.whl → 0.1.6__py3-none-any.whl

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.
@@ -2,7 +2,9 @@
2
2
 
3
3
  #include <cstdlib>
4
4
  #include <cstring>
5
+ #include <ctime>
5
6
  #include <exception>
7
+ #include <iomanip>
6
8
  #include <iostream>
7
9
  #include <sstream>
8
10
  #include <string>
@@ -10,6 +12,24 @@
10
12
 
11
13
  namespace {
12
14
 
15
+ std::string local_timestamp() {
16
+ const std::time_t now = std::time(nullptr);
17
+ std::tm local{};
18
+ #if defined(_WIN32)
19
+ localtime_s(&local, &now);
20
+ #else
21
+ localtime_r(&now, &local);
22
+ #endif
23
+ std::ostringstream out;
24
+ out << std::put_time(&local, "%Y-%m-%d %H:%M:%S");
25
+ return out.str();
26
+ }
27
+
28
+ void print_progress_log(const std::string& message) {
29
+ std::cerr << "[pdcode-simplify " << local_timestamp() << "] "
30
+ << message << '\n';
31
+ }
32
+
13
33
  bool denotes_crossingless_unknot(const std::string& text) {
14
34
  std::string compact;
15
35
  for (char c : text) {
@@ -129,7 +149,7 @@ char* pdcode_simplify_run_json(
129
149
  options.ban_heuristic = ban_heuristic != 0;
130
150
  options.verbose = verbose != 0;
131
151
  options.progress = [](const std::string& message) {
132
- std::cerr << "[pdcode-simplify] " << message << '\n';
152
+ print_progress_log(message);
133
153
  };
134
154
 
135
155
  const pdcode_simplify::PDCode code = pdcode_simplify::parse_pd_code(text);
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cpp-pd-code-simplify-interface
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Python interface for cpp-pd-code-simplify with runtime C++ compilation.
5
5
  License-Expression: MIT
6
6
  Author: GGN_2015
@@ -34,6 +34,11 @@ use, the package compiles a cached local dynamic library through
34
34
  `cpp-simple-interface`; later calls reuse that library through `ctypes`. A C++14
35
35
  compiler compatible with `g++` must be available at runtime.
36
36
 
37
+ The core C++ source and header are not stored as permanent generated copies in
38
+ this subproject. The custom Poetry build backend syncs them from the repository
39
+ root during `poetry build`, embeds them in the wheel and sdist, then removes the
40
+ temporary copies from the working tree.
41
+
37
42
  Calls use the C++ library's default preprocessing pipeline: R1-move removal
38
43
  followed by nugatory-crossing removal, then iterative mid-simplification.
39
44
 
@@ -51,7 +56,8 @@ The default `max_paths=-1` uses deterministic heuristic green-path sampling in
51
56
  the C++ backend. Use `ban_heuristic=True` to request exhaustive green-path
52
57
  enumeration for a manageable input. Use `reduction_round=K` to cap applied
53
58
  mid-simplification rounds; the default `-1` runs until stable. Use
54
- `verbose=True` to forward C++ progress logs to stderr.
59
+ `verbose=True` to forward timestamped C++ progress logs to stderr. Verbose log
60
+ lines use local wall-clock time in `YYYY-MM-DD HH:MM:SS` format.
55
61
 
56
62
  Batch use:
57
63
 
@@ -2,10 +2,10 @@ cpp_pd_code_simplify_interface/__init__.py,sha256=aaNwD--zgQX13xiU1hpuvgXy8vVTFG
2
2
  cpp_pd_code_simplify_interface/__main__.py,sha256=fdA1QWBe5LNX0fbtaJXa1-dwEhrg_4sS_5UnjaajcMo,80
3
3
  cpp_pd_code_simplify_interface/main.py,sha256=_7dPNfbtUxAC8o9cZOOwicU04zIFIA55nHIzQ_UZunw,20624
4
4
  cpp_pd_code_simplify_interface/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
- cpp_pd_code_simplify_interface-0.1.4.dist-info/entry_points.txt,sha256=ThorC4Enxp317TKITsXm9pE0gUp7pt-pP6Dl5mEPUR8,91
6
- cpp_pd_code_simplify_interface-0.1.4.dist-info/METADATA,sha256=CIMcDMWX0fa01RY04zPmN-B1D_YSKCGyNRdVWoDIrHI,2905
7
- cpp_pd_code_simplify_interface-0.1.4.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
5
+ cpp_pd_code_simplify_interface-0.1.6.dist-info/entry_points.txt,sha256=ThorC4Enxp317TKITsXm9pE0gUp7pt-pP6Dl5mEPUR8,91
6
+ cpp_pd_code_simplify_interface-0.1.6.dist-info/METADATA,sha256=4BIBNsSZDVD7xJmcAankGYXazchNjFn6kT-McVlELQM,3275
7
+ cpp_pd_code_simplify_interface-0.1.6.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
8
8
  cpp_pd_code_simplify_interface/data/include/pdcode_simplify/pdcode_simplify.hpp,sha256=P8XgFxLelCFesArCrKJ_UwqG7LlpoXiegNHLOV-DhG8,5162
9
- cpp_pd_code_simplify_interface/data/src/native_interface.cpp,sha256=LnffzIhwbGbw4xDTp5QXd-Vx23Nc9y5Xgr0AdbULlF0,6077
9
+ cpp_pd_code_simplify_interface/data/src/native_interface.cpp,sha256=yXUJ0LHZDqz7WgFTwsq0U9pddH0KFTiOPr5sNyj7o1Y,6549
10
10
  cpp_pd_code_simplify_interface/data/src/pdcode_simplify.cpp,sha256=ptDTjjSlx_Lq_2snHYWgjnIbr-mGsDG7rqTevuqoSEc,94195
11
- cpp_pd_code_simplify_interface-0.1.4.dist-info/RECORD,,
11
+ cpp_pd_code_simplify_interface-0.1.6.dist-info/RECORD,,