question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Follow-up fixes for bootstrap

See original GitHub issue

@aaronspring, just to keep the follow-up on the recent PR merge in one place. I wanted to get it merged in since it’s been sitting there so long and got so large.

Some things that need to be followed-up on to fix it (you can cite this issue in a new PR):

  • Decide if we want to maintain a separate significance level for init/uninit and persistence. If this is the case, a “quantile_persistence” and “quantile_ensemble” or something similar dimension distinction should be made to make plotting easy. The graphics plot was breaking in the notebook if the significance levels were different.
  • Revise the perfect_model notebook with your new bootstrap functions so that the whole thing compiles as you see fit.
  • Fix pytest to deal with datetime[ns]. (I think this was the problem you identified?)

Some links on the last one:

https://docs.scipy.org/doc/numpy/reference/arrays.datetime.html

https://stackoverflow.com/questions/22842314/numpy-datetime64-add-or-substract-date-interval

I’ve used those methods before to add intervals to a datetime. That might help with xr.sel().

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
aaronspringcommented, Apr 15, 2019

Decide if we want to maintain a separate significance level for init/uninit and persistence. If this is the case, a “quantile_persistence” and “quantile_ensemble” or something similar dimension distinction should be made to make plotting easy. The graphics plot was breaking in the notebook if the significance levels were different.

I want to keep different significance levels for the calculation. For the plotting I havent implemented that. Now raises an error. I am unsure still how to gather all the results into a dataset nicely (I prefer here only the variable name as one data_var).

Fix pytest to deal with datetime[ns]. (I think this was the problem you identified?)

Changed compute_persistence_pm. Didnt adapt compute_persistence yet. But should be easily adaptable.

Revise the perfect_model notebook with your new bootstrap functions so that the whole thing compiles as you see fit.

Compiles.

1reaction
aaronspringcommented, Apr 9, 2019

concerning compute_persistence_pm I found a way: I transfer the initialisation time axis into the index values of control.time, then I can easily add lags to the index.

dim='time'
nlags=ds.time.size
init_month_index=0 # januar init, 10 for november
init_years = ds['initialization'].values
init_cftimes = []
for year in init_years:
    init_cftimes.append(control.sel(time=str(year)).isel(time=init_month_index).time)
init_cftimes=xr.concat(init_cftimes,'time')

init_index=[]
l=list(control.time.values)
for i, inits in enumerate(init_cftimes.time.values):
    init_index.append(l.index(init_cftimes[i]))

plag=[]
from xskillscore import pearson_r,rmse
metric=pearson_r
for lag in range(1, 1 + nlags):
    inits_index_plus_lag = [x+lag for x in inits_index]
    ref = control.isel({dim: inits_index_plus_lag})
    fct = control.isel({dim: inits_index})
    ref[dim] = fct[dim]
    plag.append(metric(ref, fct, dim=dim))
pers_new = xr.concat(plag, 'time')
pers_new['time'] = np.arange(1, 1 + nlags)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Collect and solve Bootstrap 4 follow-up fixes #5612 - GitHub
Hi everyone, I would like to solve some of the follow-up fixes for bootstrap4. Thanks !!! All reactions.
Read more >
Follow-up from "revert: fix(deps): upgrade bootstrap-vue to v2 ...
This Merge Request will trigger no release. This means none of the commits warrant a semantic release according to conventional commits rules ( ......
Read more >
Position - Bootstrap
Position an element at the bottom of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in...
Read more >
K19785240: Bootstrap vulnerability CVE-2018-14042 - AskF5
In Bootstrap before 4.1.2, XSS is possible in the data-container property of ... Note: After a fix is introduced for a given minor...
Read more >
html - How can the Bootstrap be fixed so that it doesn't mess ...
This is kind of a follow up to my previous question, but I've been having some trouble lately with the formatting of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found