Seems like whoever defined the type that state has overloaded getproperty, but didn’t make that known through propertynames (which they should). Open an issue at the package repo in question.
# Allow setting step, laststep, dτ, shift from QMCState.
function Base.getproperty(state::QMCState, key::Symbol)
if key == :step
step = state.replicas[1].params.step
return step
elseif key == :laststep
laststep = state.replicas[1].params.laststep
return laststep
elseif key == :maxlength
return getfield(state, :maxlength)[]
elseif key == :dτ
return state.replicas[1].params.dτ
elseif key == :shift
return state.replicas[1].params.shift
else
return getfield(state, key)
end
end
function Base.setproperty!(state::QMCState, key::Symbol, value)
if key == :step
for r in state.replicas
r.params.step = value
end
return value
elseif key == :laststep
for r in state.replicas
r.params.laststep = value
end
return value
elseif key == :dτ
for r in state.replicas
r.params.dτ = value
end
return value
elseif key == :shift
for r in state.replicas
r.params.shift = value
end
return value
elseif key == :maxlength
getfield(state, :maxlength)[] = value
return value
else
# This will error
return setfield!(state, key, value)
end
end