Open Anaphory opened 5 years ago
I don't think the implementation of the command line argument versus the config file option for sampling from prior is clean.
I think it should be like this:
prior
_prior
--prior
sample_from_prior = True
So, this line https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L98 is correct.
https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L170 only serves for generic value reading from the config file and if we ever do that well for documenting that config file parameter.
https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L194 suggests that it is useful to keep prior around as config attribute, and I think this is wrong: Only one of sample_from_prior and prior should be kept alive, in particular to avoid confusion further down:
sample_from_prior
https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L293 overloads self.sample_from_prior with self.prior, but then the subsequent lines use self.prior, and one even duplicates the functionality from L98 (see above), but in a slightly more clever (too clever, in particular once we implement proper config-interpolation) way.
self.sample_from_prior
self.prior
https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/beastxml.py#L144 is where this is used in building the XML, suggesting that .sample_from_prior is the canonical attribute.
.sample_from_prior
Remove all traces of the config.prior attribute, replacing it by config.sample_from_prior or the function argument prior as appropriate.
config.prior
config.sample_from_prior
I don't think the implementation of the command line argument versus the config file option for sampling from prior is clean.
I think it should be like this:
prior
is set from the command line, the basename is extended by_prior
.--prior
or because ofsample_from_prior = True
.So, this line https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L98 is correct.
https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L170 only serves for generic value reading from the config file and if we ever do that well for documenting that config file parameter.
https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L194 suggests that it is useful to keep
prior
around as config attribute, and I think this is wrong: Only one ofsample_from_prior
andprior
should be kept alive, in particular to avoid confusion further down:https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/configuration.py#L293 overloads
self.sample_from_prior
withself.prior
, but then the subsequent lines useself.prior
, and one even duplicates the functionality from L98 (see above), but in a slightly more clever (too clever, in particular once we implement proper config-interpolation) way.https://github.com/lmaurits/BEASTling/blob/b422d1644e118d87e78c50e7d50194bb21f69edb/beastling/beastxml.py#L144 is where this is used in building the XML, suggesting that
.sample_from_prior
is the canonical attribute.To Do
Remove all traces of the
config.prior
attribute, replacing it byconfig.sample_from_prior
or the function argumentprior
as appropriate.