Closed JanJereczek closed 1 year ago
can you please resolve the conflicts @JanJereczek ? (And please always ensure this is the case when you make a PR, otherwise CI doesn't run)
Should be ok now! I will make sure there is no conflict in the future
The built documentation is here: https://juliadynamics.github.io/TransitionIndicators.jl/previews/PR19/
which I'll read and give feedback about soon! I promise! Hopefully before monday!
@JanJereczek thanks a lot for putting the effort into the docs. It looks good, but it also can get better.
Alright, here we go for the review:
init_metaanalysis_params
is inappropriate. If we have a type MetaanalysisParameters
then this function is its constructor and should have the same name. Morever, the names should be specific. This meta analysis is specifically for significance. So I would say, just make a struct SignificanceMetaParams
and use this name for the function as well.precomputed_ridge_slope
and why we can't use ridge_slope
directly. In general keep this in mind: the less amount of names we have in the API, the better.Surrogate
". This is very specific, because Surrogate
is something completely specific: sometjhing defined concretely within the package TimeseriesSurrogates.jlconfidence_intervall
has two l
measure_significance(res, significance_metric)
, Compute the significance_metric
on the results res
of an indicator metaanalysis". What is an indicator metaanalysis? Be specific. Is it the output a specific function? If yes, explicitly say so and link this function with @ref
. Is it a specific type? if so, explicitly say so. In general: be explicit: code is better than english.measure_signficance
has a reason to exist? measure_significances
has no reason to exist though, right? isn't it the broadcasting of the measure_significance
?the most important part I think is to re-write the tutorial so that it holds the hand of the user step by step all the way through.
after the meeting: name SignificanceHyperParams
is what we thought was best
All comments have been embedded! Ready for review :)
This versions also includes the struct/function dispatch for RidgeRegression
. I created FunctionalStruct <: Function
as abstract type so that f(x::Vector, metric::Function)
accepts such functions. Not sure it is the way to go though...
The solution is to define
struct YourName <: Function
# .,,.,.,
end
you don't need the extra type hierarchy.
Hahaha, I went rather for: why make things simple when you can make them complicated?
Thanks for the comment, it is now implemented without the introduction of a new type!
@JanJereczek very important, read this: https://docs.julialang.org/en/v1/manual/style-guide/#Write-functions-with-argument-ordering-similar-to-Julia-Base
practically every function that accepts a function as an argument, this argument should be first, not second. Like in our ...(x, indicator, ...)
.
@JanJereczek another very important thing. Stop declaring types. You only should declare types in case of new method definition or in case of mandatory subtyping. This means, you should be as general with your type delcerations as possible. If you can avoid declering a type in a function definition, then you should. If you can use a supertype, you should. Always prefer AbstractVector
instead of Vector
unless there is an absolutely specific reason to use Vector
.
(I am now workign intensively o nthe PR, please don't push anything)
Another comment: the function is_equispaced
violates the "do 1 thing rule". Its name also suggests that it should return a boolean only.
Another comment: the way you have defined SignificanceHyperParams
is problematic. The significance is tested with the surrogates and a significance test. The SignificanceHyperParams
should have nothing to do with the creation of the indicator timeseries. This should be a completely independent step. The significance struct should have the wv_evolution_width
stuff.
By the way, the names at the moment are incredibly hard to parse. What is "evolution_width" referring to...? It is very hard to understand that this is about the length of the "change" estimating function, that estimates how much an indicator changes.
Alright, I will establish the following names:
The change metric timeseries is used to detect significant transitions.
Hi George,
Thanks for all the detailed corrections and explanations! I'll let you finish what you are doing. When you're done let me know and I would gladly correct anything that still should be.
For the future: I'll read more code from JuliaDynamics packages to internalize better the best practices and hopefully reduce the time you spend on corrections!
Another comment: don't leave TODO comments like "implem,ent lfps". Make them GitHub issues instead.
The built documentation is here: https://juliadynamics.github.io/TransitionIndicators.jl/previews/PR19/
Major changes:
load_data.jl
has function to load time series of minimal example. Maybe more time series will be included in future.Minor changes:
StatsBase.jl
.