Skip to content

Commit

Permalink
1. update ostap.utils.valerrors & and new test
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Aug 7, 2024
1 parent 31740bc commit 03a3db9
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 64 deletions.
8 changes: 5 additions & 3 deletions ReleaseNotes/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
1. Activate a new `draw` method (via `tree_draw`) for `ROOT.TTree`
1. add `progress` and `report` optioal argumens for (almost) all Frame-related functions
1. Some tweaks for style configuration

## Backward incompatible
1. update `ostap.utils.valerrors` & and new test

## Backward incompatibl

1. `project`(&`draw`) for 2 and 3-dimession now follows the natural order of varibales:
`XX.project ( target , 'x,y,z' , ...) `
1. For `eff` & effic' and `efficinecy` methods fo r1D histograms
the confusing optional argument `increasing=True` is replced by (less-confusin)
`cut_low` and the argument is not optionl anymore

1. From now for weighted datasets `dataset[i]` returns `(entry,weight)` tuple
1. from now iteration over weighted dataset gives `(entry,weight)` tuple

## Bug fixes

Expand Down
11 changes: 5 additions & 6 deletions ostap/fitting/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from ostap.utils.utils import evt_range, LAST_ENTRY, ALL_ENTRIES
from ostap.stats.statvars import data_decorate, data_range
from ostap.histos.histos import histo_book
from ostap.utils.valerrors import VAE
import ostap.fitting.roocollections
import ostap.fitting.printable
import ROOT, random, math, sys, ctypes
Expand All @@ -59,9 +60,7 @@
_maxv = 0.99 * sys.float_info.max
_minv = -0.99 * sys.float_info.max
# =============================================================================

# =============================================================================
## iterator for RooAbsData
## iterator for RooAbsData entries
# - For unweighted dataset `entry` is a RooArsSet
# @cdoe
# dataset = ...
Expand Down Expand Up @@ -125,11 +124,11 @@ def _rad_getitem_ ( data , index ) :

entry = data.get ( index )
if not data.isWeighted() : return entry

weight = data.weight()
if data.store_asym_error () :
wel, weh = data.weightErrors ()
return entry, weight , wel, weh ## RETURN
wel , weh = data.weightErrors ()
weight = VAE ( weight , wel , weh )
elif data.store_error () :
we = data.weightError ()
if 0 <= we : weight = VE ( weight , we * we )
Expand Down
6 changes: 2 additions & 4 deletions ostap/histos/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,7 @@ def _grae_setitem_ ( graph , ipoint , point ) :
assert 2 <= n <= 6 , "Invalid lenght of 'point' object"

pars = point



## extract X
p0 = pars [ 0 ]
## "ready-to-use"
Expand Down Expand Up @@ -1093,8 +1092,7 @@ def _grae_iteritems_ ( graph ) :

# =============================================================================


if (6,20) <= root_info :
if ( 6 , 20 ) <= root_info :
# =============================================================================
## iterate over points in TGraphMultiErrors
# @code
Expand Down
Loading

0 comments on commit 03a3db9

Please sign in to comment.