Changelog¶
v0.1.3 (16.01.2019)¶
This is a bugfix version in preparation for the wrapper rewrite in 0.1.4.
- Fixed: Crash due to logfiles. If the toolbox was used by more than one user on one machine, the logfile created in the temporary directory could not be overwritten by other users. We now try to set file permissions of the logfile and target directory to
777
if they are not subfolders of the user folder. Also, per default, each user gets their own directory/tmp/mre_username
. Logfilehandler is now rotating and creates a maximum of 10 logfiles, 50mb each. - Fixed:
full_analysis()
no longer crashes withsubstracttrialaverage=True
when the provided input is of integer type. - Fixed:
fit()
now returns a (mostly empty)FitResult
when no fit converged instead of raising an exception. Helps with scripts that run multiple fits. The returned FitResult works with the OutputHandler in default settings and a note about the failed fit is added to the description and meta data. - Fixed: Calling
coefficients()
with custom steps e.g.steps=np.arange(0,100,5)
is more robust and does not crash due tosteps < 1
. Incorrect entries are replaced. - Fixed:
OutputHandler
now has a deconstructor that closes the matplotlib figure if it was not provided as an arugment. Hence, opening many handlers (e.g. by reassigning a variable in a loopo = mre.OutputHandler()
) does not keep the figure after reusing the variable. This used to cause a warning:More than 20 figures have been opened.
- Changed: If no
steps
are provided tocoefficients()
, the default maxstep is (for now) 1/10 of the trial length. (Was hard coded to 1500 before) - Changed: Default logs are less verbose to be clearer. The new function
mre._enable_detailed_logging()
enables fully detailed output to console and logfile. This also calls the two new switches, see next point.mre._enable_detailed_logging()
also enables console display of runtime warnings that are usually only printed into the log. - New: Enable logging of function arguments to console and logfile with
mre._log_locals = True
. Enable logging of stack traces to logfile viamre._log_trace = True
. (Avoiding the console printout of stack traces on exceptions is not feasible at the moment). Per default, both options areFalse
.
v0.1.2 (27.11.2018)¶
- Changed:
coefficients()
withtrialseparate
method calculatesrk
differently (now strictly linear regression). This should enablem>1
estimates. - Changed: builtin fitfunctions now use absolute values of the amplitude of the exponential term
- Changed: fits drawn above data (again), otherwise, they get hidden if data is noisy
- Fixed: maximum steps
k
incoefficients
cannot exceed half the trial length any longer. this could lead to strong fluctuations inr_k
and fits would fail - Fixed: Crashes when providing custom fitfunctions to
fit()
due to unhandled request of default parameters - New: Rasterization of plots in the
OutputHandler
. Especially timeseries grow large quickly. Now, if OutputHandlers create their own figures/axes elements (ax
-argument not given on construction) all elements withzorder<0
are rastered. Per default,add_ts()
uses azorder
of-1
butadd_coefficients()
andadd_fit()
have values above one so they stay vectorized. Callax.set_rasterization_zorder(0)
on your customax
axes element if you want the same effect on customized figures. - New: export as png option for
OutputHandler.save_plot()
v0.1.1 (01.11.2018)¶
- Changed: We reworked the structure of
CoefficientResult
to be more consistent. This is now a completely selfsimilar , where each child-entry has exactly the same structure as the parent. The new attributestrialcrs
andbootstrapcrs
replacedsamples
. Both are now lists containing againCoefficientResults
, any (previously multidmensional) ndarrays are now 1d. - Changed: Per default,
full_analysis()
initialises the random number generator (used for bootstrapping) once per call and passesNone
to the seed arguments of lower functions so they do not reseed. We introduced the convention thatseed=None
tells that function to use the current state of the rng without seeding. (Added anauto
option for seeding where needed) - Changed: All prints now use the logging module. Hopefully nothing broke :P.
- Changed: Default log level to console is now ‘INFO’, and some logs that one could consider info go to ‘DEBUG’ to decrease the spam. Default loglevel to file is ‘DEBUG’ (logfile placed in the default temporary directory, which is also printed when loading the toolbox).
- Changed: When providing no loglevel to
full_analysis()
it uses the currently set level ofmre._logstreamhandler
. - Fixed: When calling
full_analysis()
with one trial, a running average is shown instead of an empty plot. - New: Added quantiles (and standard errors) to fit results if bootstrapping. The new default option,
numboot='auto'
calculates 250 bootstrap samples for the exponential and exp+offset fit functions (which are decently fast) and skips error estimation for the builtin complex (and custom) fits. - New: Added function
set_logfile(fname, loglevel='DEBUG')
to change the path of the global logfile + level. This should allow running the toolbox in parallel, with a seperate logfile per thread and relatively silent/no console output when combining withmre._logstreamhandler.setLevel('ERROR')
or callingfull_analysis(..., loglevel='ERROR')
- New: Undocumented way to change the respective loglevels is e.g.
mre._logstreamhandler.setLevel('WARNING')
for console andmre._logfilehandler.setLevel('DEBUG')
for file - New: Added custom handler class that does not log ‘None Type’ Traces if
log.exception()
is called without atry
statement
v0.1.0 (11.10.2018)¶
- Changed: OutputHandlers set_xdata() now adjusts existing data and is slightly smarter. Now returns an array containing the indices where the x axis value is right for the provided data (wrt the existing context). See the example in the documentation.
- Changed: When calling OutputHanlders
add_coefficients()
oradd_ts()
, the meta data and plot range will be extended usingset_xdata
. Trying to add duplicates only changes their style to the new provided values (without adding meta). - Changed: The parameters of
simulate_branching()
are different.activity
is nowa
,m
is no longer optional and it is possible to set a (time dependent) drive usingh
. - Fixed: Calling
fit()
with only one trial does not crash anymore due to missing uncertainties - Fixed: Calling
fit()
without specifyingsteps
now uses the range used incoefficients()
. - New: added
full_analysis()
, the wrapper function to chain individual tasks together. - New: added
simulate_subsampling()
- New: Whenn adding time series to the
OutputHandler
in trial structure with more than one trial viaadd_ts()
, they are drawn slightly transparent by default. Settingalpha
overwrites this.add_ts
does not use the newset_xdata()
yet. - New: Versionbump so we have the last digit for bugfixes :)
- New: Mr. Estimator came up with his logo.
v0.0.3 (19.09.2018)¶
- Changed: Check for old numpy versions in
fit()
- Changed: Per default, fits are drawn solid (dashed) over the fitted (remaining) range
- Fixed: Typos
(14.09.2018)¶
- New: CoefficientResult constructor now has some default arguments. Still required:
steps
andcoefficients
. Also added thedt, dtunit
attributes. - New: FitResult constructor now has some default arguments. Still required: ‘tau, mre, fitfunc’. Also added the
dt, dtunit, steps
attributes. - New:
fit()
takes argumentsteps=(minstep, maxstep)
to specify a custom fitrange.OutputHandler
plots the fitted range opaque (excluded range has less alpha). - Changed:
dt
is no longer an argument forfit()
. Settingdt
(the step size) and its unitsdtunit
is done via the equally named parameters ofcoefficients()
. It is added to theCoefficientResult
, sofit
and theOutputHandler
can rely on it.
(13.09.2018)¶
- Renamed: module from
mre
tomrestimator
, useimport mrestimator as mre
- Renamed:
correlation_coefficients()
tocoefficients()
- Renamed:
correlation_fit()
tofit()
- Renamed:
CorrelationFitResult
toFitResult