cpp-pd-code-simplify-interface 0.1.5__tar.gz → 0.1.6__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.
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/PKG-INFO +3 -2
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/README.md +2 -1
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/data/src/native_interface.cpp +21 -1
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/pyproject.toml +1 -1
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/build_backend/cpp_pd_code_simplify_interface_build_backend.py +0 -0
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/__init__.py +0 -0
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/__main__.py +0 -0
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/data/include/pdcode_simplify/pdcode_simplify.hpp +0 -0
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/data/src/pdcode_simplify.cpp +0 -0
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/main.py +0 -0
- {cpp_pd_code_simplify_interface-0.1.5 → cpp_pd_code_simplify_interface-0.1.6}/cpp_pd_code_simplify_interface/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cpp-pd-code-simplify-interface
|
|
3
|
-
Version: 0.1.
|
|
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
|
|
@@ -56,7 +56,8 @@ The default `max_paths=-1` uses deterministic heuristic green-path sampling in
|
|
|
56
56
|
the C++ backend. Use `ban_heuristic=True` to request exhaustive green-path
|
|
57
57
|
enumeration for a manageable input. Use `reduction_round=K` to cap applied
|
|
58
58
|
mid-simplification rounds; the default `-1` runs until stable. Use
|
|
59
|
-
`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.
|
|
60
61
|
|
|
61
62
|
Batch use:
|
|
62
63
|
|
|
@@ -36,7 +36,8 @@ The default `max_paths=-1` uses deterministic heuristic green-path sampling in
|
|
|
36
36
|
the C++ backend. Use `ban_heuristic=True` to request exhaustive green-path
|
|
37
37
|
enumeration for a manageable input. Use `reduction_round=K` to cap applied
|
|
38
38
|
mid-simplification rounds; the default `-1` runs until stable. Use
|
|
39
|
-
`verbose=True` to forward C++ progress logs to stderr.
|
|
39
|
+
`verbose=True` to forward timestamped C++ progress logs to stderr. Verbose log
|
|
40
|
+
lines use local wall-clock time in `YYYY-MM-DD HH:MM:SS` format.
|
|
40
41
|
|
|
41
42
|
Batch use:
|
|
42
43
|
|
|
@@ -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
|
-
|
|
152
|
+
print_progress_log(message);
|
|
133
153
|
};
|
|
134
154
|
|
|
135
155
|
const pdcode_simplify::PDCode code = pdcode_simplify::parse_pd_code(text);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|