Skip to content

Conversation

@IvanaGyro
Copy link
Collaborator

"slient" argument was corrected to "silent" in #666. However, that change broke the current Python API. This PR adds "slient" back and marks it deprecated until v2.0.0.

  • Restore 'slient' parameter support to fix API breaking change from previous commit
  • Add FutureWarning for deprecated 'slient' parameter using py::warnings
  • Implement robust argument validation with detailed error messages
  • Bump pybind11 requirement to >=3.0 (py::warnings available since pybind11 3.0)
  • Add comprehensive test suite covering deprecation warnings, argument validation, and edge cases

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.05%. Comparing base (4515341) to head (7910138).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #672      +/-   ##
==========================================
+ Coverage   26.07%   28.05%   +1.98%     
==========================================
  Files         215      215              
  Lines       47590    43948    -3642     
  Branches    18395    16805    -1590     
==========================================
- Hits        12407    12328      -79     
+ Misses      33158    29617    -3541     
+ Partials     2025     2003      -22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jysh1214
Copy link
Collaborator

How about:

// Helper function to parse the 'silent' argument for get_blocks_() method                                                                                                                                  
// This function handles backward compatibility with the deprecated 'slient' parameter
static inline bool check_silent(py::args args, py::kwargs kwargs) { 
    // ...
}

.def("get_blocks_", [](const UniTensor& self, py::args args, py::kwargs kwargs) {
    return self.get_blocks_(check_silent(...));
}
.def("get_blocks_", [](UniTensor& self, py::args args, py::kwargs kwargs) {
    return self.get_blocks_(check_silent(...));
}

- Restore 'slient' parameter support to fix API breaking change from
    previous commit
- Add FutureWarning for deprecated 'slient' parameter using py::warnings
- Implement robust argument validation with detailed error messages
- Bump pybind11 requirement to >=3.0 (py::warnings available since
    pybind11 3.0)
- Add comprehensive test suite covering deprecation warnings, argument
    validation, and edge cases
@IvanaGyro
Copy link
Collaborator Author

How about:

// Helper function to parse the 'silent' argument for get_blocks_() method                                                                                                                                  
// This function handles backward compatibility with the deprecated 'slient' parameter
static inline bool check_silent(py::args args, py::kwargs kwargs) { 
    // ...
}

.def("get_blocks_", [](const UniTensor& self, py::args args, py::kwargs kwargs) {
    return self.get_blocks_(check_silent(...));
}
.def("get_blocks_", [](UniTensor& self, py::args args, py::kwargs kwargs) {
    return self.get_blocks_(check_silent(...));
}

Extracted the function.

@IvanaGyro IvanaGyro requested a review from jysh1214 September 15, 2025 17:38
Copy link
Collaborator

@jysh1214 jysh1214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@IvanaGyro IvanaGyro merged commit 0e81a53 into master Sep 16, 2025
7 checks passed
@IvanaGyro IvanaGyro deleted the deprecate-slient branch September 16, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants