Skip to content

[REFACTOR] move FFid to algorithm - #3293

Merged
timosachsenberg merged 2 commits into
OpenMS:developfrom
timosachsenberg:feature/FFid_to_algo
Mar 15, 2018
Merged

timosachsenberg merged 2 commits into
OpenMS:developfrom
timosachsenberg:feature/FFid_to_algo

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Mar 9, 2018 •

Copy link
Copy Markdown
Contributor

Factored out FFid to an algorithm.

@hroest

hroest commented Mar 9, 2018

Copy link
Copy Markdown
Contributor

looks good - of course it is now missing a test :-)

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Yes, I know ;). Don't know which policy we should have.
I think one could argue for being

  1. strict regarding the tests or
  2. supporting changes/refactoring that don't hold up to the formal standards i.e., to not discourage that kind of improvements. After all, its usually an improvement and he number of tests did not decrease ;)

Maybe something we could discuss at the developer meeting.

@hroest

hroest commented Mar 10, 2018

Copy link
Copy Markdown
Contributor

👍 if @hendrikweisser agrees

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

@hendrikweisser I added a test stub. Do you have some test code available? Otherwise, I would leave it as is (tested via TOPP tool test).

@hendrikweisser

Copy link
Copy Markdown
Contributor

Sorry, I haven't had time to look at this yet. I'll try to do it later today or tomorrow.

Regarding tests, I would say leave it as it is for now and open a ticket for missing FFId class tests.

@hendrikweisser hendrikweisser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for doing this thankless job, Timo. ;-)

I've left some comments. In general:

  • Can you configure your editor to not put spaces before "&"/"*" in references/pointers, please?
  • Type const always looks weird to me, especially when mixed with the (standard) const Type.
  • There may be more includes that can now be removed in the TOPP tool implementation.
  • In the header file, format comments so they can be picked up by Doxygen (where appropriate).

std::vector<ProteinIdentification> proteins,
std::vector<PeptideIdentification> peptides_ext,
std::vector<ProteinIdentification> proteins_ext,
FeatureMap & features

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No space before "&".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, it is not my editor (vim) that does that but me ;)
That way, I find it much easier to spot if references are passed.

I have seen "Type const" being used more often recently and I think newer
compiler sometimes complain about using: "const auto &" instead of "auto const &".

I don't care too much about these two style issues and would in principle be willing to adopt whatever you like. But I would like to make these style questions more of a community decision.
Most important thing is to be consistent than to decide for A or B,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We had the discussion about spaces around "*" and "&" before. It is still in our Coding Conventions (https://github.com/OpenMS/OpenMS/wiki/Coding-conventions), although not all the examples on that page are consistent with it:

If function arguments are pointers or references, the pointer or reference qualifier is appended to the variable type. It should not prefix the variable name.

The problem with spaces on both sides is that it makes it look like a mathematical operator (more of an issue for "*").

The vast majority of the code in OpenMS uses "const Type", so absent a good reason to the contrary, we should stick to that - as you said, consistency is most important.

FeatureMap & features
);

void runOnCandidates(FeatureMap & features);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No space before "&".

typedef FeatureFinderAlgorithmPickedHelperStructs::MassTrace MassTrace;
typedef FeatureFinderAlgorithmPickedHelperStructs::MassTraces MassTraces;

// mapping: RT (not necessarily unique) -> pointer to peptide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use "///" here so Doxygen picks up those comments? (Also below.)

const PeakMap& getChromatograms() const { return chrom_data_; }

ProgressLogger& getProgressLogger() { return prog_log_; }
ProgressLogger const & getProgressLogger() const { return prog_log_; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

const ProgressLogger& ...

}

void FeatureFinderIdentificationAlgorithm::postProcess_(
FeatureMap & features,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No space before "&".

// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// --------------------------------------------------------------------------
// $Maintainer: $

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maintainer/author missing.

FeatureFinderIdentificationAlgorithm* null_ptr = 0;
START_SECTION(FeatureFinderIdentificationAlgorithm())
{
ptr = new FeatureFinderIdentificationAlgorithm();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use standard amount of identation (two spaces).

#include <OpenMS/ANALYSIS/TARGETED/TargetedExperiment.h>
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/FeatureFinderIdentificationAlgorithm.h>

#include <OpenMS/CHEMISTRY/IsotopeDistribution.h>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this be removed here?

#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/EGHTraceFitter.h>
#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/GaussTraceFitter.h>

#include <boost/shared_ptr.hpp>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can the two Boost includes be removed here?

@@ -39,19 +39,15 @@
#include <OpenMS/ANALYSIS/OPENSWATH/ChromatogramExtractor.h>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can these OpenSWATH includes be removed here?

@timosachsenberg

timosachsenberg commented Mar 15, 2018 •

Copy link
Copy Markdown
Contributor Author

thanks for the review. I will address the issues you brought up.

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

failed test unrelated

@timosachsenberg
timosachsenberg merged commit cf5952a into OpenMS:develop Mar 15, 2018
@timosachsenberg
timosachsenberg deleted the feature/FFid_to_algo branch April 9, 2018 17:54
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.

3 participants