forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[aot] Deprecate filename arg in ti.aot.Module.save() (taichi-dev#6554)
Issue: # ### Brief Summary `filename` argument in `ti.aot.Module.save()` has been no-op for a long time. This PR deprecates it and annouce that it'll be removed in v1.4.0 release. Also added a test file called `test_deprecation.py` which is designed to be the place to check all DeprecationWarnings so that before every release we can just check here to see if we can safely remove any deprecated apis.
- Loading branch information
Showing
3 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import tempfile | ||
|
||
import pytest | ||
|
||
import taichi as ti | ||
from tests import test_utils | ||
|
||
|
||
@test_utils.test(arch=[ti.vulkan, ti.opengl, ti.cuda, ti.cpu]) | ||
def test_deprecated_aot_save_filename(): | ||
density = ti.field(float, shape=(4, 4)) | ||
|
||
with tempfile.TemporaryDirectory() as tmpdir: | ||
m = ti.aot.Module(ti.lang.impl.current_cfg().arch) | ||
m.add_field('density', density) | ||
with pytest.warns( | ||
DeprecationWarning, | ||
match= | ||
r'Specifying filename is no-op and will be removed in release v1.4.0' | ||
): | ||
m.save(tmpdir, 'filename') |