Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nnpdf
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Emanuele Roberto Nocera
nnpdf
Commits
1229126c
Unverified
Commit
1229126c
authored
3 years ago
by
Zaharid
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #1287 from NNPDF/pi_fix
Fixing plotting info labeler functions
parents
439d59c6
4da660a3
No related branches found
Branches containing commit
Tags
4.0.3
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
conda-recipe/meta.yaml
+5
-2
5 additions, 2 deletions
conda-recipe/meta.yaml
conda-recipe/run_test.sh
+0
-2
0 additions, 2 deletions
conda-recipe/run_test.sh
validphys2/src/validphys/plotoptions/core.py
+32
-0
32 additions, 0 deletions
validphys2/src/validphys/plotoptions/core.py
with
37 additions
and
4 deletions
conda-recipe/meta.yaml
+
5
−
2
View file @
1229126c
...
...
@@ -12,12 +12,14 @@ requirements:
-
swig
-
cmake
-
pkg-config
# See https://github.com/NNPDF/nnpdf/pull/1280
-
sysroot_linux-64==2.17
# [linux]
host
:
-
lhapdf
# with python wrapper
-
sqlite
-
gsl
# Gsl doesn't link openblas on old debian 7
-
libarchive ==3.4.2
# See https://github.com/NNPDF/nnpdf/pull/1130
-
yaml-cpp
-
yaml-cpp
>=0.6.3
-
apfel >=3
# see https://github.com/scarrazza/apfel
-
python
-
numpy
...
...
@@ -34,7 +36,7 @@ requirements:
-
gsl
-
numpy
-
libarchive
-
yaml-cpp
-
yaml-cpp
>=0.6.3
-
apfel
-
pkg-config
-
python
# requirements for validphys
...
...
@@ -61,6 +63,7 @@ test:
#Build dependencies for catch tests
-
{{
compiler("cxx")
}}
-
{{
compiler("c")
}}
-
sysroot_linux-64==2.17
# [linux]
-
swig ==3.0.10
-
cmake
...
...
This diff is collapsed.
Click to expand it.
conda-recipe/run_test.sh
+
0
−
2
View file @
1229126c
...
...
@@ -26,5 +26,3 @@ vp-setupfit --legacy ../nnpdfcpp/config/testconfig.yml
chi2check testconfig NNPDF31_nnlo_as_0118
#Print linkage data
conda inspect linkages
-p
$PREFIX
$PKG_NAME
This diff is collapsed.
Click to expand it.
validphys2/src/validphys/plotoptions/core.py
+
32
−
0
View file @
1229126c
...
...
@@ -13,6 +13,8 @@ import numpy as np
import
pandas
as
pd
import
numbers
from
validobj
import
ValidationError
from
reportengine.floatformatting
import
format_number
from
reportengine.compat
import
yaml
from
reportengine.utils
import
get_functions
,
ChainMap
...
...
@@ -207,6 +209,7 @@ class Scale(enum.Enum):
@dataclasses.dataclass
class
PlottingOptions
:
func_labels
:
dict
=
dataclasses
.
field
(
default_factory
=
dict
)
dataset_label
:
typing
.
Optional
[
str
]
=
None
experiment
:
typing
.
Optional
[
str
]
=
None
nnpdf31_process
:
typing
.
Optional
[
str
]
=
None
...
...
@@ -233,6 +236,31 @@ class PlottingOptions:
extra_labels
:
typing
.
Optional
[
typing
.
Mapping
[
str
,
typing
.
List
]]
=
None
def
parse_figure_by
(
self
):
if
self
.
figure_by
is
not
None
:
for
el
in
self
.
figure_by
:
if
el
in
labeler_functions
:
self
.
func_labels
[
el
]
=
labeler_functions
[
el
]
def
parse_line_by
(
self
):
if
self
.
line_by
is
not
None
:
for
el
in
self
.
line_by
:
if
el
in
labeler_functions
:
self
.
func_labels
[
el
]
=
labeler_functions
[
el
]
def
parse_x
(
self
):
if
self
.
x
is
not
None
and
self
.
x
not
in
self
.
all_labels
:
raise
ValidationError
(
f
"
The label
{
self
.
x
}
is not in the set of known labels
{
self
.
all_labels
}
"
)
@property
def
all_labels
(
self
):
if
self
.
extra_labels
is
None
:
return
set
(
default_labels
)
return
set
(
self
.
extra_labels
.
keys
()).
union
(
set
(
default_labels
))
def
__post_init__
(
self
):
if
self
.
kinematics_override
is
not
None
:
self
.
kinematics_override
=
transform_functions
[
...
...
@@ -241,6 +269,10 @@ class PlottingOptions:
if
self
.
result_transform
is
not
None
:
self
.
result_transform
=
result_functions
[
self
.
result_transform
.
name
]
self
.
parse_figure_by
()
self
.
parse_line_by
()
self
.
parse_x
()
@dataclasses.dataclass
class
PlottingFile
(
PlottingOptions
):
...
...
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