lmaurits / BEASTling

A linguistics-focussed command line tool for generating BEAST XML files.
BSD 2-Clause "Simplified" License
20 stars 6 forks source link

Refactored core config sections #247

Closed xrotwang closed 5 years ago

xrotwang commented 5 years ago

Options of the core config sections admin, mcmc and languages are now accessed as attributes of instances of the respective sections.Section subclass and not as direct attributes of Configuration.

This

Closes #243

xrotwang commented 5 years ago

What remains to do:

codecov-io commented 5 years ago

Codecov Report

Merging #247 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #247   +/-   ##
=====================================
  Coverage       0%     0%           
=====================================
  Files          28     29    +1     
  Lines        3092   3014   -78     
=====================================
+ Misses       3092   3014   -78
Impacted Files Coverage Δ
beastling/__main__.py 0% <ø> (ø) :arrow_up:
beastling/models/covarion.py 0% <0%> (ø) :arrow_up:
beastling/extractor.py 0% <0%> (ø) :arrow_up:
beastling/util/misc.py 0% <0%> (ø) :arrow_up:
beastling/models/basemodel.py 0% <0%> (ø) :arrow_up:
beastling/report.py 0% <0%> (ø) :arrow_up:
beastling/treepriors/base.py 0% <0%> (ø) :arrow_up:
beastling/clocks/prior.py 0% <0%> (ø) :arrow_up:
beastling/models/geo.py 0% <0%> (ø) :arrow_up:
beastling/beastxml.py 0% <0%> (ø) :arrow_up:
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c5cb7c4...c7883ca. Read the comment docs.

xrotwang commented 5 years ago

@lmaurits @Anaphory I just pushed a commit replacing the messages mechanism with standard python logging. Let me know if you'd want this to be reverted. Using logging feels a lot more "right" to me, though - in particular because we had this ad-hoc re-invention of log levels as part of the message before.

xrotwang commented 5 years ago

See https://github.com/lmaurits/BEASTling/pull/247/commits/0beec0312075176ba2c09a69fbef730b7663c49a#diff-4d1ff12693ff7665889a62c693b937cd for the new logging functionality. Usage is simple:

from beastling.util import log

...
    log.info('msg', model=...)
    log.dependency('function', 'package')
...
Anaphory commented 5 years ago

Just from a first glance without checks and tests yet: Sweet!

How will we deal with models? It feels like there should be some sub-classes involved, do you already know how to do that?

xrotwang commented 5 years ago

@Anaphory I'd go for the geo sections next, and then cook something up for models.

xrotwang commented 5 years ago

Another "next step" I see here is adding write support to Section - basically the inverse of from_config. This would allow us to also embed a valid BEASTling config into the BEAST XML when it was created programmatically.