Skip to content
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 option to skip binding a field #257

Merged
merged 3 commits into from
May 3, 2023

Conversation

jlblancoc
Copy link
Contributor

This commit is based on a larger commit by @charbeljc in #160 but manually cherry-picking just the "-field" feature.

This commit is based on a larger commit by @charbeljc
in #160
but manually cherry-picking just the "-field" feature.
Copy link
Member

@lyskov lyskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for implementing this @jlblancoc , - looks very useful! I adding minor comment on current code but otherwise it looks good and i will be happy to merge it. However, it would be great if we can also add minimal test for this functionality. Would you be interested in doing it? If yes please see https://github.com/RosettaCommons/binder/tree/master/test and particularly check tests with custom config files like https://github.com/RosettaCommons/binder/blob/master/test/T80.custom_trampoline.config. If that is too much then we can merge this as-is (after addressing comment below). Thanks,

bool Config::is_field_skipping_requested(string const &field_) const
{
string field {field_};
field.erase(std::remove(field.begin(), field.end(), ' '), field.end());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is needed? At line 214 https://github.com/RosettaCommons/binder/pull/257/files#diff-72f8d59ab463236c54ef8c3a2c8fb31c72efad5003751b3e342c868079de19baR214 we added fields name without namespaces so it looks like it this line will not do anything. I am brining this up due to performance consideration: in large projects this check might be called numerous times.

@jlblancoc
Copy link
Contributor Author

Sure! One doubt: what version of clang-format are you using to format the files? I tried clang-format-11 and clang-format-15 and both changes much more than just my changes...

@lyskov
Copy link
Member

lyskov commented May 1, 2023

@jlblancoc re clang-format version: unless i am mistaken it was v13

@jlblancoc
Copy link
Contributor Author

Hi @lyskov ! It's done now:

  • You were right, the space trimming code wasn't needed. It's removed.
  • Added a unit test. See 630cf44

There are other weird things I noticed in the way, but kept changes minimal in this PR anyway, please check them for subsequent commits?:

  • test/self-test.py only works with python2.7. I had to manually change a couple of lines to make it work with python3.
  • no clang-format version seems to be actually applied to existing sources (some of them). Please, check if running "clang-format-XX -i FILE" on all sources make changes for you too, and commit them so it's easier to keep the formatting for contributors :-)
  • It's confusing why only part of the test/*.hpp files are handled at the cmake + make test level, but then there is an apparently independent way to run tests via "build-and-run-tests.py" (??).

That said... congrats for the huge project, it literally made my life easier :-)

Copy link
Member

@lyskov lyskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lyskov
Copy link
Member

lyskov commented May 3, 2023

Thank you for your feedback and for adding test for this @jlblancoc !

  • test/self-test.py only works with python2.7. I had to manually change a couple of lines to make it work with python3.

-- yes, thank you for brining this up! I am aware of this and will escalate update to Python-3.

  • no clang-format version seems to be actually applied to existing sources (some of them).

-- thank you for letting me know! Looks like quite a few changes got accumulated since last clang format run, - i will looks this up.

  • It's confusing why only part of the test/*.hpp files are handled at the cmake + make test level, but then there is an apparently independent way to run tests via "build-and-run-tests.py" (??).

-- cmake tests does not compare test results (only makes sure that results is compilable) and they also require system-wide install of LLVM which is not always practical during development.

Again, thank you for your PR and feedback @jlblancoc ! I will merge this shortly.

@lyskov lyskov merged commit 67a9fe4 into RosettaCommons:master May 3, 2023
@jlblancoc
Copy link
Contributor Author

Got it. Thanks you!

ldedier-gpfw pushed a commit to G-P-S/binder that referenced this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants