-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add experiment type #702
Add experiment type #702
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #702 +/- ##
=======================================
Coverage 41.81% 41.81%
=======================================
Files 187 187
Lines 16806 16810 +4
Branches 3210 3211 +1
=======================================
+ Hits 7027 7029 +2
- Misses 9133 9140 +7
+ Partials 646 641 -5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can resolve the definition of sequences of stills, I am happy
src/dxtbx/model/__init__.py
Outdated
|
||
def all_sequences(self): | ||
"""Check if all the experiments are from sequences""" | ||
return all(exp.is_sequence() for exp in self) | ||
warnings.warn("all_sequences() is deprecated. Use all_rotations() instead") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A still sequence
is meaningful e.g. grid scan
@@ -74,6 +74,11 @@ namespace dxtbx { namespace model { namespace boost_python { | |||
}; | |||
|
|||
void export_experiment() { | |||
enum_<ExperimentType>("ExperimentType") | |||
.value("still", still) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a sequence of stills?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate that the behaviour of the current system is not well defined?
src/dxtbx/model/experiment.h
Outdated
@@ -28,6 +28,8 @@ | |||
|
|||
namespace dxtbx { namespace model { | |||
|
|||
enum ExperimentType { rotation = 1, still = 2, tof = 3 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enumerations are usually ENUMERATED
?
Discussion from core:
|
bab5155
to
d355b28
Compare
…equence, and experiment_list.all_sequences. ExperimentType is now all caps. is_still and is_sequence call get_type to ensure they remain consistent.
* Added ExperimentType to Experiment, accessed via get_type().
This adds
Experiment.get_type()
, which returns anExperimentType
enum. The idea is to replaceExperiment.is_still()/Experiment.is_sequence()
with something more flexible.There is an argument that this goes a bit against the dials as a toolkit ethos, where you should be able to mix pipelines of algorithms. However, the workflow for stills and rotational experiments are distinct enough that a quick way of identifying them is useful (
is_still()
), and time of flight experiments are similar in being quite separate.Experiments do not have a static enum applied to their type. Instead it's calculated on the fly to ensure it's always consistent and defined in only one place.