-
Notifications
You must be signed in to change notification settings - Fork 4
Rename dsm to dsf and add Python support
#302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
setup.py
Outdated
| import os | ||
| import sys | ||
| import platform | ||
| import subprocess |
Check notice
Code scanning / Bandit (reported by Codacy)
Consider possible security implications associated with subprocess module. Note
| class CMakeBuild(build_ext): | ||
| def run(self): | ||
| try: | ||
| subprocess.check_output(["cmake", "--version"]) |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note
| class CMakeBuild(build_ext): | ||
| def run(self): | ||
| try: | ||
| subprocess.check_output(["cmake", "--version"]) |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a partial executable path Note
| # Use Ninja if available in the current environment, otherwise use Unix Makefiles | ||
| use_ninja = False | ||
| try: | ||
| subprocess.check_output(["ninja", "--version"]) |
Check notice
Code scanning / Bandit (reported by Codacy)
Starting a process with a partial executable path Note
| # Use Ninja if available in the current environment, otherwise use Unix Makefiles | ||
| use_ninja = False | ||
| try: | ||
| subprocess.check_output(["ninja", "--version"]) |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note
| else: | ||
| cmake_args += ["-G", "Unix Makefiles"] | ||
|
|
||
| subprocess.check_call(["cmake", ext.sourcedir] + cmake_args, cwd=build_temp) |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note
| cmake_args += ["-G", "Unix Makefiles"] | ||
|
|
||
| subprocess.check_call(["cmake", ext.sourcedir] + cmake_args, cwd=build_temp) | ||
| subprocess.check_call( |
Check notice
Code scanning / Bandit (reported by Codacy)
subprocess call - check for execution of untrusted input. Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cppcheck (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the framework from dsm to dsf and adds support for Python bindings.
- Renames all dsm references to dsf across source, examples, benchmarks, and documentation.
- Updates build scripts and CMake files to reflect the new naming and include Python bindings support.
Reviewed Changes
Copilot reviewed 85 out of 85 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| examples/stalingrado.cpp, slow_charge_tl.cpp, etc. | Updates include renaming of headers, namespace, and logging calls from dsm to dsf. |
| examples/README.md | Documentation updated to reflect new dsf naming and build instructions. |
| CMakeLists.txt (project root) | Project configuration and library setup updated with dynamic version extraction and Python bindings option. |
| Benchmark and workflow files | All benchmark and CI configuration files updated to include dsf rather than dsm. |
| string(REGEX MATCH "DSF_VERSION_MAJOR = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | ||
| set(DSF_VERSION_MAJOR ${CMAKE_MATCH_1}) | ||
| string(REGEX MATCH "DSF_VERSION_MINOR = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | ||
| set(DSF_VERSION_MINOR ${CMAKE_MATCH_1}) | ||
| string(REGEX MATCH "DSF_VERSION_PATCH = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | ||
| set(DSF_VERSION_PATCH ${CMAKE_MATCH_1}) | ||
|
|
Copilot
AI
Jun 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a fallback or error-handling mechanism if the version extraction from dsf.hpp fails, to ensure that an appropriate version is always set during the build.
| string(REGEX MATCH "DSF_VERSION_MAJOR = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | |
| set(DSF_VERSION_MAJOR ${CMAKE_MATCH_1}) | |
| string(REGEX MATCH "DSF_VERSION_MINOR = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | |
| set(DSF_VERSION_MINOR ${CMAKE_MATCH_1}) | |
| string(REGEX MATCH "DSF_VERSION_PATCH = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | |
| set(DSF_VERSION_PATCH ${CMAKE_MATCH_1}) | |
| if(NOT DEFINED DSF_HPP_CONTENT OR DSF_HPP_CONTENT STREQUAL "") | |
| message(WARNING "Failed to read dsf.hpp. Using default version 0.0.0.") | |
| set(DSF_VERSION_MAJOR 0) | |
| set(DSF_VERSION_MINOR 0) | |
| set(DSF_VERSION_PATCH 0) | |
| else() | |
| string(REGEX MATCH "DSF_VERSION_MAJOR = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | |
| if(NOT DEFINED CMAKE_MATCH_1) | |
| message(WARNING "Failed to extract DSF_VERSION_MAJOR. Using default value 0.") | |
| set(DSF_VERSION_MAJOR 0) | |
| else() | |
| set(DSF_VERSION_MAJOR ${CMAKE_MATCH_1}) | |
| endif() | |
| string(REGEX MATCH "DSF_VERSION_MINOR = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | |
| if(NOT DEFINED CMAKE_MATCH_1) | |
| message(WARNING "Failed to extract DSF_VERSION_MINOR. Using default value 0.") | |
| set(DSF_VERSION_MINOR 0) | |
| else() | |
| set(DSF_VERSION_MINOR ${CMAKE_MATCH_1}) | |
| endif() | |
| string(REGEX MATCH "DSF_VERSION_PATCH = ([0-9]+)" _ ${DSF_HPP_CONTENT}) | |
| if(NOT DEFINED CMAKE_MATCH_1) | |
| message(WARNING "Failed to extract DSF_VERSION_PATCH. Using default value 0.") | |
| set(DSF_VERSION_PATCH 0) | |
| else() | |
| set(DSF_VERSION_PATCH ${CMAKE_MATCH_1}) | |
| endif() | |
| endif() |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #302 +/- ##
==========================================
- Coverage 84.78% 84.48% -0.30%
==========================================
Files 38 38
Lines 5574 5673 +99
Branches 572 578 +6
==========================================
+ Hits 4726 4793 +67
- Misses 848 880 +32
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.