Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
1b0802d2
Commit
1b0802d2
authored
Jun 03, 2021
by
Wout De Nolf
Browse files
scan_saving: deprecate technique
parent
bf34b958
Changes
7
Hide whitespace changes
Inline
Side-by-side
bliss/scanning/scan_saving.py
View file @
1b0802d2
...
...
@@ -749,7 +749,6 @@ class ESRFScanSaving(BasicScanSaving):
"date_format"
:
"%Y%m%d"
,
"scan_number_format"
:
"%04d"
,
"dataset_number_format"
:
"%04d"
,
"technique"
:
""
,
# saved properties in Redis:
"_writer_module"
:
"nexus"
,
"_proposal"
:
""
,
...
...
@@ -796,12 +795,16 @@ class ESRFScanSaving(BasicScanSaving):
self
.
_remove_deprecated
()
def
_remove_deprecated
(
self
):
"""Remove deprecated items from existing Redis databases"""
stored
=
self
.
to_dict
()
if
"_sample"
in
stored
:
# Deprecated in Bliss 1.7
# Deprecated in Bliss
>
1.7
.0
value
=
stored
[
"_sample"
]
self
.
remove
(
"._sample"
)
self
.
_collection
=
value
if
"technique"
in
stored
:
# Deprecated in Bliss > 1.8.0
self
.
remove
(
"technique"
)
def
__dir__
(
self
):
keys
=
super
().
__dir__
()
...
...
doc/docs/data_policy.md
View file @
1b0802d2
...
...
@@ -108,7 +108,6 @@ DEMO [5]: SCAN_SAVING
.
date_format
=
'%Y%m%d'
.
scan_number_format
=
'%04d'
.
dataset_number_format
=
'%04d'
.
technique
=
''
.
session
=
'demo'
.
date
=
'20200208'
.
scan_name
=
'{scan_name}'
...
...
doc/docs/dev_data_policy_custom.md
View file @
1b0802d2
...
...
@@ -12,14 +12,14 @@ class Session:
self
.
env_dict
[
"SCAN_SAVING"
]
=
self
.
scan_saving
```
Creating a custom data policy means deriving a class from
`bliss.scanning.scan_saving.Bas
e
ScanSaving`
:
Creating a custom data policy means deriving a class from
`bliss.scanning.scan_saving.Bas
ic
ScanSaving`
:
```
python
class
CustomScanSaving
(
Bas
e
ScanSaving
):
class
CustomScanSaving
(
Bas
ic
ScanSaving
):
DEFAULT_VALUES
=
{
# default and not removable values
"
technique"
:
"
"
,
"
scan_number_format"
:
"%04d
"
,
...
# saved properties in Redis:
"_proposal"
:
""
,
...
...
tests/nexus_writer/conftest.py
View file @
1b0802d2
...
...
@@ -207,7 +207,7 @@ def prepare_scan_saving(session=None, tmpdir=None, policy=True, **kwargs):
)
scan_saving
.
proposal_name
=
"testproposal"
technique
=
nxw_test_config
.
technique
[
"withpolicy"
]
scan_saving
.
technique
=
technique
scan_saving
.
proposal
.
all
.
definition
=
technique
measurementgroup
.
set_active_name
(
technique
+
"MG"
)
else
:
tmpdir
=
str
(
tmpdir
)
...
...
tests/nexus_writer/test_nxw_plotselect.py
View file @
1b0802d2
...
...
@@ -21,7 +21,7 @@ def _test_nxw_plotselect(
):
scan_saving
=
session
.
scan_saving
env_dict
=
session
.
env_dict
scan_saving
.
technique
=
"
"
scan_saving
.
dataset
.
all
.
definition
=
"none
"
detectors
=
[
env_dict
[
name
]
for
name
in
[
"diode3"
,
"diode4"
,
"diode5"
]]
scan_shape
=
(
10
,)
...
...
tests/nexus_writer/test_nxw_readers.py
View file @
1b0802d2
...
...
@@ -41,7 +41,7 @@ def _test_nxw_readers(
config
=
True
,
**
kwargs
):
session
.
scan_saving
.
technique
=
"none"
session
.
scan_saving
.
dataset
.
all
.
definition
=
"none"
detector
=
"diode3"
detectorobj
=
session
.
env_dict
[
detector
]
...
...
tests/nexus_writer/test_nxw_scangroup.py
View file @
1b0802d2
...
...
@@ -40,7 +40,10 @@ def test_nxw_scangroup_base_nopolicy(nexus_writer_base_nopolicy):
@
nxw_test_utils
.
writer_stdout_on_exception
def
_test_nxw_scangroup
(
session
=
None
,
tmpdir
=
None
,
writer
=
None
,
**
kwargs
):
session
.
scan_saving
.
add
(
"technique"
,
"none"
)
try
:
session
.
scan_saving
.
dataset
.
all
.
definition
=
"none"
except
AttributeError
:
pass
# data policy disabled
npoints
=
10
detector1
=
session
.
env_dict
[
"diode3"
]
detector2
=
session
.
env_dict
[
"diode4"
]
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment