Skip to content

Commit 1ae57b6

Browse files
Added docstrings to methods and properties of frozen function
1 parent b05b9c3 commit 1ae57b6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drjit/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,13 +1990,32 @@ def __call__(self, *args, **kwargs):
19901990

19911991
@property
19921992
def n_recordings(self):
1993+
"""
1994+
Represents the number of times the function was recorded. This
1995+
includes occasions where it was recorded due to a dry-run failing.
1996+
It does not necessarily correspond to the number of recordings
1997+
currently cached see ``n_cached_recordings`` for that.
1998+
"""
19931999
return self.frozen.n_recordings
19942000

19952001
@property
19962002
def n_cached_recordings(self):
2003+
"""
2004+
Represents the number of recordings currently cached of the frozen
2005+
function. If a recording fails in dry-run mode, it will not create
2006+
a new recording, but replace the recording that was attemted to be
2007+
replayed. The number of recordings can also be limited with
2008+
the ``max_cache_size`` argument.
2009+
"""
19972010
return self.frozen.n_cached_recordings
19982011

19992012
def clear(self):
2013+
"""
2014+
Clears the recordings of the frozen function, and resets the
2015+
``n_recordings`` counter. The reference to the function is still
2016+
kept, and the frozen function can be called again to re-trace
2017+
new recordings.
2018+
"""
20002019
return self.frozen.clear()
20012020

20022021
def __get__(self, obj, type=None):

0 commit comments

Comments
 (0)