Skip to content

Commit

Permalink
fix some linter suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
axsk committed Feb 19, 2024
1 parent b630ff2 commit 784372b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/ISOKANN.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module ISOKANN

#include("forced/IsoForce.jl")

import Random

using LinearAlgebra: norm, dot, cross
using StatsBase: mean, sample, mean_and_std
using Molly: Molly, System
Expand All @@ -18,7 +20,7 @@ import ProgressMeter
using SpecialFunctions: erf
using Plots: plot, plot!, scatter, scatter!

using MLUtils: numobs, getobs, shuffleobs
using MLUtils: numobs, getobs, shuffleobs, unsqueeze

import ChainRulesCore
import Flux
Expand Down
2 changes: 1 addition & 1 deletion src/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ end
subsample(data, nx)
return a random subsample of `nx` points from `data` """
function subsample(trajdata, nx)
function subsample(data, nx)
i = sample(1:numobs(data), nx, replace=false)
return getobs(data, i)
end
Expand Down
2 changes: 1 addition & 1 deletion src/isomolly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function learnbatch!(model, xs::AbstractMatrix, target::AbstractVector, opt, bat
(0 < batchsize < ndata) || return learnstep!(model, xs, target, opt)

l = sum(Flux.DataLoader((xs, target); batchsize, shuffle=true)) do (xs, target)
learnstep!(model, xs, target, opt) * length(ind)
learnstep!(model, xs, target, opt) * numobs(xs)
end
return l / ndata
end
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/langevin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function solve_end(l::AbstractLangevin; u0)
end

## Generic Diffusion in a potential
@with_kw struct Diffusion{T} <: AbstractLangevin
@kwdef struct Diffusion{T} <: AbstractLangevin
potential::T
dim::Int64=1
sigma::Vector{Float64} = [1.0]
Expand Down
2 changes: 1 addition & 1 deletion src/simulators/molly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const isokann_data_dir = joinpath(dirname(pathof(ISOKANN)), "..", "data")
molly_data(path) = joinpath(molly_data_dir, path)
isokann_data(path) = joinpath(isokann_data_dir, path)

molly_forcefields(ffs) = MolecularForceField(map(ffs) do ff
molly_forcefields(ffs) = Molly.MolecularForceField(map(ffs) do ff
molly_data("force_fields/$ff")
end...)

Expand Down

0 comments on commit 784372b

Please sign in to comment.