Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RDStar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Metzner
RDStar
Commits
1c4d3343
Commit
1c4d3343
authored
3 years ago
by
Kilian Lieret
Browse files
Options
Downloads
Patches
Plain Diff
Also catch deprecation warnings
parent
079ce30a
Branches
make_d_columns_configurable
No related tags found
1 merge request
!90
Make d columns configurable
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rdstar/mc_reweighting/BFReweighting/d_bf_reweighting.py
+5
-3
5 additions, 3 deletions
rdstar/mc_reweighting/BFReweighting/d_bf_reweighting.py
with
5 additions
and
3 deletions
rdstar/mc_reweighting/BFReweighting/d_bf_reweighting.py
+
5
−
3
View file @
1c4d3343
...
...
@@ -72,7 +72,6 @@ class DBFReweighter:
self
.
signal_side_only
=
signal_side_only
assert
all
(
col
in
self
.
df
.
columns
for
col
in
DBFReweighter
.
get_required_columns
())
@classmethod
def
get_required_columns
(
cls
)
->
List
[
str
]:
req_cols
=
[
cls
.
b_mdst_col
,
cls
.
b_mdst_tau_col
]
...
...
@@ -232,8 +231,11 @@ class DBFReweighter:
# Actual command:
self
.
df
[
"
temp
"
]
=
list
(
zip
(
*
[
self
.
df
[
"
temp
"
+
var
]
for
var
in
decay_vars
]))
for
w
in
warning
:
assert
issubclass
(
w
.
category
,
SettingWithCopyWarning
)
assert
"
A value is trying to be set on a copy
"
in
str
(
w
.
message
)
is_setting_with_copy_warning
=
issubclass
(
w
.
category
,
SettingWithCopyWarning
)
is_setting_with_copy_warning
&=
"
A value is trying to be set on a copy
"
in
str
(
w
.
message
)
is_deprecation_warning
=
issubclass
(
w
.
category
,
DeprecationWarning
)
if
not
is_setting_with_copy_warning
|
is_deprecation_warning
:
raise
ValueError
(
f
"
Caught warning of category
{
w
.
category
}
and message
{
w
.
message
}
"
)
self
.
df
.
loc
[
conds
,
decay_col
]
=
self
.
df
[
"
temp
"
]
for
var
in
decay_vars
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment