Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refactor parameters#17

Merged
dwhswenson merged 3 commits into
openpathsampling:masteropenpathsampling/openpathsampling-cli:masterfrom
dwhswenson:refactor_paramsdwhswenson/openpathsampling-cli:refactor_paramsCopy head branch name to clipboard
Mar 3, 2020
Merged

Refactor parameters#17
dwhswenson merged 3 commits into
openpathsampling:masteropenpathsampling/openpathsampling-cli:masterfrom
dwhswenson:refactor_paramsdwhswenson/openpathsampling-cli:refactor_paramsCopy head branch name to clipboard

Conversation

@dwhswenson

Copy link
Copy Markdown
Member

Previously, the get function for OPSStorageLoadSingle (objects that try to guess which thing was desired if no CLI value is provided) had a high degree of complexity.

But basically, what was happening internally was that, for each specific parameter, the code tries a prioritized sequence of strategies -- places to look for an object. If that doesn't work, then it goes to the next strategy.

This has more directly implemented that idea. For each parameter, there is a set of strategies to use if the command line receives a value, and another to use if there is no command line value. The resulting code is a little longer, but easier to interpret and much more flexible/resusable. And looking at the parameter definitions, it is much easier to understand what will happen for each parameter.

@dwhswenson dwhswenson added the refactor Restructuring code; little functionality change label Mar 3, 2020
@dwhswenson dwhswenson merged commit 7471eda into openpathsampling:master Mar 3, 2020
@dwhswenson dwhswenson deleted the refactor_params branch March 3, 2020 14:38
This was referenced Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Restructuring code; little functionality change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.