Skip to content

Commit 7c8a09e

Browse files
committed
Fix argument type annotation and move filepath generation to gen()
1 parent b570d37 commit 7c8a09e

File tree

3 files changed

+15
-7
lines changed
  • lib/node_modules/@stdlib/math/base/special
  • tools/snippets/test/fixtures/python

3 files changed

+15
-7
lines changed

lib/node_modules/@stdlib/math/base/special/cosm1/test/fixtures/python/runner.py

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/node_modules/@stdlib/math/base/special/exp10/test/fixtures/python/runner.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/snippets/test/fixtures/python/runner.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import json
77
import os
88

9-
"""gen( x, filepath )
9+
"""gen( x, name )
1010
1111
Generate fixture data and write to file.
1212
1313
# Arguments
1414
1515
* `x`: domain
16-
* `filepath::AbstractString`: filepath of the output file
16+
* `name::str`: output filename
1717
1818
# Examples
1919
@@ -22,14 +22,18 @@
2222
python> gen( x, \"./data.json\" );
2323
```
2424
"""
25-
def gen( x, filepath ):
25+
def gen( x, name ):
2626
# TODO: generate fixtures
2727

2828
# Store data to be written to file as a dictionary:
2929
data = {
3030
"x": x.tolist(),
3131
"expected": y.tolist()
3232
};
33+
34+
# Based on the script directory, create an output filepath:
35+
filepath = os.path.join( dir, name )
36+
3337
with open( filepath, 'w' ) as outfile:
3438
json.dump( data, outfile )
3539

0 commit comments

Comments
 (0)