lmaurits / BEASTling

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

Isn't there some configparser logic for this? #197

Open Anaphory opened 6 years ago

Anaphory commented 6 years ago

The covarion model tests its share_params property manually. https://github.com/lmaurits/BEASTling/blob/00eb06979f4965e5586d5c3ba24b427e028ad9a9/beastling/models/covarion.py#L12 Wasn't there some ConfigParser logic to do this, or a more general method we have already written elsewhere?

Anaphory commented 6 years ago

Also, share_params = False needs test coverage. And documentation.

lmaurits commented 5 years ago

In configuration.py, the get_model_config method of Configuration uses ConfigParser to build a dictionary of key/value pairs read from the a [model] section. This dictionary gets passed to the __init__ method of the appropriate model class. The model class itself gets no direct access to the configuration file. This means anything which is model-specific (share_params applies only to binary models) cannot be handled via ConfigParser.

I'm not saying this way of doing this is smart, just answering your question by explaining the current architecture. Now that we are refactoring the way config files are read, there's the possibility to do this kind of thing differently if we think it's for the best.

Of course, this ties into #200 as well.