From ef495c688198d89cf0277ca7d85bf6379d6bf492 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 May 2026 20:31:56 +0000 Subject: [PATCH 1/2] style: align `stats/base/dists/logistic/stdev` with namespace conventions Add Julia fixture infrastructure (`test/fixtures/julia/REQUIRE` and `test/fixtures/julia/runner.jl`) to match the namespace convention used by 13/15 sibling packages (87%). The runner mirrors `stats/base/dists/logistic/variance/test/fixtures/julia/runner.jl`, substituting `Distributions.std` for `Distributions.var`. Existing Python fixtures are left untouched; switching the test suite over to the Julia data is left to a follow-up maintainer call. --- .../stdev/test/fixtures/julia/REQUIRE | 3 + .../stdev/test/fixtures/julia/runner.jl | 73 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/REQUIRE create mode 100644 lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/REQUIRE b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/REQUIRE new file mode 100644 index 000000000000..98be20b58ed3 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/REQUIRE @@ -0,0 +1,3 @@ +Distributions 0.23.8 +julia 1.5 +JSON 0.21 diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl new file mode 100644 index 000000000000..228fd0c0d2b5 --- /dev/null +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl @@ -0,0 +1,73 @@ +#!/usr/bin/env julia +# +# @license Apache-2.0 +# +# Copyright (c) 2018 The Stdlib Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import Distributions: std, Logistic +import JSON + +""" + gen( mu, s, name ) + +Generate fixture data and write to file. + +# Arguments + +* `mu`: location parameter +* `s`: scale parameter +* `name::AbstractString`: output filename + +# Examples + +``` julia +julia> mu = rand( 1000 ) .* -10.0; +julia> s = rand( 1000 ) .* 5.0; +julia> gen( mu, s, "data.json" ); +``` +""" +function gen( mu, s, name ) + z = Array{Float64}( undef, length(mu) ); + for i in eachindex(mu) + z[ i ] = std( Logistic( mu[i], s[i] ) ); + end + + # Store data to be written to file as a collection: + data = Dict([ + ("mu", mu), + ("s", s), + ("expected", z) + ]); + + # 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" ); + close( outfile ); +end + +# Get the filename: +file = @__FILE__; + +# Extract the directory in which this file resides: +dir = dirname( file ); + +# Generate fixtures: +mu = rand( 100 ) .* 2.0 .- 4.0; +s = rand( 100 ) .* 5.0; +gen( mu, s, "data.json" ); From 48f8014ab29382b3d6a2078bf364534061b14326 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 3 May 2026 20:34:33 +0000 Subject: [PATCH 2/2] fix: set 2026 copyright year on new `stats/base/dists/logistic/stdev` Julia runner Lint Copyright Years CI failed because the file was scaffolded from the 2018-vintage `variance/test/fixtures/julia/runner.jl` template without resetting the year on a newly added file. --- .../base/dists/logistic/stdev/test/fixtures/julia/runner.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl index 228fd0c0d2b5..70abf7b7dbca 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl +++ b/lib/node_modules/@stdlib/stats/base/dists/logistic/stdev/test/fixtures/julia/runner.jl @@ -2,7 +2,7 @@ # # @license Apache-2.0 # -# Copyright (c) 2018 The Stdlib Authors. +# Copyright (c) 2026 The Stdlib Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.