Skip to content

Commit 04299b9

Browse files
committed
Finish naming migration
1 parent 84948ce commit 04299b9

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ This tool may be useful for debugging those sorts of issues.
105105

106106
## Usage
107107

108-
1. Call `using TrackedFloats`; you may want to include functions like `enable_nan_injection` or `tf_config_logger` or the like. (See below for more details.)
108+
1. Call `using TrackedFloats`; you may want to include functions like `tf_enable_nan_injection` or `tf_config_logger` or the like. (See below for more details.)
109109
2. Add additional customization to logging and injection.
110110
3. Wrap as many of your inputs in `TrackedFloatN` as you can.
111111

@@ -169,16 +169,16 @@ TrackedFloats can *inject* `NaN`s at random points in your program to help you f
169169

170170
```julia
171171
# Inject 2 NaNs
172-
enable_nan_injection(2)
172+
tf_enable_nan_injection(2)
173173

174174
# Inject 2 NaNs, except when in the function "nope" in "way.jl"
175-
enable_nan_injection(n_inject=2, functions=[FunctionRef("nope", "way.jl")])
175+
tf_enable_nan_injection(n_inject=2, functions=[FunctionRef("nope", "way.jl")])
176176

177177
# Enable recording of injections
178-
record_injection("tf_recording") # this is just the file basename; will have timestamp prepended
178+
tf_record_injection("tf_recording") # this is just the file basename; will have timestamp prepended
179179

180180
# Enable recording playback
181-
replay_injection("20230530T145830-tf_recording.txt")
181+
tf_reply_injection("20230530T145830-tf_recording.txt")
182182
```
183183

184184
Keyword arguments for `tf_config_injector`:

src/Config.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ a keyword argument to `tf_config_logger`.
320320
tf_exclude_stacktrace(exclusions = [:prop]) = tf_config.log.exclusions = exclusions
321321

322322
"""
323-
enable_nan_injection(n_inject::Int)
323+
tf_enable_nan_injection(n_inject::Int)
324324
325325
Turn on NaN injection and injection `n_inject` NaNs. Does not modify odds,
326326
function and library lists, or recording/replay state.
327327
328-
enable_nan_injection(; odds::Int = 10, n_inject::Int = 1, functions::Array{FunctionRef} = [], libraries::Array{String} = [])
328+
tf_enable_nan_injection(; odds::Int = 10, n_inject::Int = 1, functions::Array{FunctionRef} = [], libraries::Array{String} = [])
329329
330330
Turn on NaN injection. Optionally configure the odds for injection, as well as
331331
the number of NaNs to inject, and the functions/libraries in which to inject
@@ -370,26 +370,26 @@ function enable_injection(; odds::Int = 10, n_inject::Int = 1, value::Any = NaN,
370370
end
371371

372372
"""
373-
disable_nan_injection()
373+
tf_disable_nan_injection()
374374
375375
Turn off NaN injection.
376376
377-
If you want to re-enable NaN injection after calling `disable_nan_injection`,
378-
consider using the one-argument form of `enable_nan_injection(n_inject::Int)`.
377+
If you want to re-enable NaN injection after calling `tf_disable_nan_injection`,
378+
consider using the one-argument form of `tf_enable_nan_injection(n_inject::Int)`.
379379
"""
380380
tf_disable_nan_injection() = tf_config.inj.active = false
381381
tf_disable_inf_injection() = tf_config.inj.active = false
382382
disable_injection() = tf_config.inj.active = false
383383

384384
"""
385-
record_injection(recording_file::String="tf_recording")
385+
tf_record_injection(recording_file::String="tf_recording")
386386
387387
Turn on recording.
388388
"""
389389
tf_record_injection(recording_file::String="tf_recording") = tf_config.inj.record = recording_file
390390

391391
"""
392-
replay_injection(replay_file::String)
392+
tf_reply_injection(replay_file::String)
393393
394394
Sets the injector to read from a replay file.
395395

src/TrackedFloats.jl

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module TrackedFloats
33
export FtConfig, tf_init, TrackedFloat16, TrackedFloat32, TrackedFloat64, FunctionRef
44
export LoggerConfig, tf_config_logger, tf_exclude_stacktrace, tf_print_log, tf_flush_logs
55
export InjectorConfig, tf_config_injector, tf_enable_nan_injection, tf_disable_nan_injection, tf_enable_inf_injection, tf_disable_inf_injection, tf_record_injection, tf_replay_injection
6-
# migration: start again with adding tf_ to enable_nan_injection
76
export SessionConfig, tf_config_session
87

98
include("SharedStructs.jl") # Structures used in multiple places throughout TrackedFloats

0 commit comments

Comments
 (0)