diff --git a/lib/node_modules/@stdlib/math/base/special/sincos/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/sincos/test/fixtures/julia/runner.jl old mode 100644 new mode 100755 index ed55529e641e..162fb045b072 --- a/lib/node_modules/@stdlib/math/base/special/sincos/test/fixtures/julia/runner.jl +++ b/lib/node_modules/@stdlib/math/base/special/sincos/test/fixtures/julia/runner.jl @@ -19,31 +19,38 @@ import JSON """ - gen( domain, filepath ) + gen( domain, name ) Generate fixture data and write to file. # Arguments * `domain`: domain -* `filepath::AbstractString`: filepath of the output file +* `name::AbstractString`: output filename # Examples ``` julia -julia> x = range( -1000.0, stop = 1000.0, length = 2001 ); -julia> gen( x, \"./data.json\" ); +julia> x = linspace( -1000, 1000, 2001 ); +julia> gen( x, \"data.json\" ); ``` """ -function gen( domain, filepath ) +function gen( domain, name ) x = collect( domain ); s = sin.( x ); c = cos.( x ); + + # Store data to be written to file as a collection: data = Dict([ ("x", x), ("sine", s), ("cosine", c) ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: outfile = open( filepath, "w" ); write( outfile, JSON.json(data) ); write( outfile, "\n" ); @@ -58,30 +65,24 @@ dir = dirname( file ); # Negative medium sized values: x = range( -256.0*pi, stop = 0.0, length = 4000 ); -out = joinpath( dir, "medium_negative.json" ); -gen( x, out ); +gen( x, "medium_negative.json" ); # Positive medium sized values: x = range( 0.0, stop = 256.0*pi, length = 4000 ); -out = joinpath( dir, "medium_positive.json" ); -gen( x, out ); +gen( x, "medium_positive.json" ); # Negative large values: x = range( -2.0^20*(pi/2.0), stop = -2.0^60*(pi/2.0), length = 4000 ); -out = joinpath( dir, "large_negative.json" ); -gen( x, out ); +gen( x, "large_negative.json" ); # Positive large values: x = range( 2.0^20*(pi/2.0), stop = 2.0^60*(pi/2.0), length = 4000 ); -out = joinpath( dir, "large_positive.json" ); -gen( x, out ); +gen( x, "large_positive.json" ); # Negative huge values: x = range( -2.0^60*(pi/2.0), stop = -2.0^1000*(pi/2.0), length = 4000 ); -out = joinpath( dir, "huge_negative.json" ); -gen( x, out ); +gen( x, "huge_negative.json" ); # Positive huge values: x = range( 2.0^60*(pi/2.0), stop = 2.0^1000*(pi/2.0), length = 4000 ); -out = joinpath( dir, "huge_positive.json" ); -gen( x, out ); +gen( x, "huge_positive.json" ); diff --git a/lib/node_modules/@stdlib/math/base/special/sincosd/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/sincosd/test/fixtures/julia/runner.jl index 7f1bc45857c3..47e0a17a83af 100755 --- a/lib/node_modules/@stdlib/math/base/special/sincosd/test/fixtures/julia/runner.jl +++ b/lib/node_modules/@stdlib/math/base/special/sincosd/test/fixtures/julia/runner.jl @@ -19,31 +19,38 @@ import JSON """ - gen( domain, filepath ) + gen( domain, name ) Generate fixture data and write to file. # Arguments * `domain`: domain -* `filepath::AbstractString`: filepath of the output file +* `name::AbstractString`: output filename # Examples ``` julia -julia> x = range( -1000.0, stop = 1000.0, length = 2001 ); -julia> gen( x, \"./data.json\" ); +julia> x = linspace( -1000, 1000, 2001 ); +julia> gen( x, \"data.json\" ); ``` """ -function gen( domain, filepath ) +function gen( domain, name ) x = collect( domain ); s = sind.( x ); c = cosd.( x ); + + # Store data to be written to file as a collection: data = Dict([ ("x", x), ("sine", s), ("cosine", c) ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: outfile = open( filepath, "w" ); write( outfile, JSON.json(data) ); write( outfile, "\n" ); @@ -58,30 +65,24 @@ dir = dirname( file ); # Negative medium sized values: x = range( -256.0*180.0, stop = 0.0, length = 4000 ); -out = joinpath( dir, "medium_negative.json" ); -gen( x, out ); +gen( x, "medium_negative.json" ); # Positive medium sized values: x = range( 0.0, stop = 256.0*180.0, length = 4000 ); -out = joinpath( dir, "medium_positive.json" ); -gen( x, out ); +gen( x, "medium_positive.json" ); # Negative large values: x = range( -2.0^20*(180.0/2.0), stop = -2.0^60*(180.0/2.0), length = 4000 ); -out = joinpath( dir, "large_negative.json" ); -gen( x, out ); +gen( x, "large_negative.json" ); # Positive large values: x = range( 2.0^20*(180.0/2.0), stop = 2.0^60*(180.0/2.0), length = 4000 ); -out = joinpath( dir, "large_positive.json" ); -gen( x, out ); +gen( x, "large_positive.json" ); # Negative huge values: x = range( -2.0^60*(180.0/2.0), stop = -2.0^1000*(180.0/2.0), length = 4000 ); -out = joinpath( dir, "huge_negative.json" ); -gen( x, out ); +gen( x, "huge_negative.json" ); # Positive huge values: x = range( 2.0^60*(180.0/2.0), stop = 2.0^1000*(180.0/2.0), length = 4000 ); -out = joinpath( dir, "huge_positive.json" ); -gen( x, out ); +gen( x, "huge_positive.json" ); diff --git a/lib/node_modules/@stdlib/math/base/special/sincospi/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/math/base/special/sincospi/test/fixtures/julia/runner.jl old mode 100644 new mode 100755 index af83fe0e3a40..8794fad9ac7f --- a/lib/node_modules/@stdlib/math/base/special/sincospi/test/fixtures/julia/runner.jl +++ b/lib/node_modules/@stdlib/math/base/special/sincospi/test/fixtures/julia/runner.jl @@ -19,31 +19,38 @@ import JSON """ - gen( domain, filepath ) + gen( domain, name ) Generate fixture data and write to file. # Arguments * `domain`: domain -* `filepath::AbstractString`: filepath of the output file +* `name::AbstractString`: output filename # Examples ``` julia -julia> x = range( -1000, stop = 1000, length = 2001 ); -julia> gen( x, \"./data.json\" ); +julia> x = linspace( -1000, 1000, 2001 ); +julia> gen( x, \"data.json\" ); ``` """ -function gen( domain, filepath ) +function gen( domain, name ) x = collect( domain ); s = sinpi.( x ); c = cospi.( x ); + + # Store data to be written to file as a collection: data = Dict([ ("x", x), ("sin", s), ("cos", c) ]); + + # Based on the script directory, create an output filepath: + filepath = joinpath( dir, name ); + + # Write the data to the output filepath as JSON: outfile = open( filepath, "w" ); write( outfile, JSON.json(data) ); write( outfile, "\n" ); @@ -58,10 +65,8 @@ dir = dirname( file ); # Generate fixture data for integer values: x = range( -1000.0, stop = 1000.0, length = 2001 ); -out = joinpath( dir, "integers.json" ); -gen( x, out ); +gen( x, "integers.json" ); # Generate fixture data for decimal values: x = range( -100.0, stop = 100.0, length = 2003 ) -out = joinpath( dir, "decimals.json" ); -gen( x, out ); +gen( x, "decimals.json" );