mne-cpp icon indicating copy to clipboard operation
mne-cpp copied to clipboard

Preambles in header and source files

Open LorenzE opened this issue 2 years ago • 0 comments

Based on a discussion in #902 with @gabrielbmotta and @juangpc.

IMO the preamble should only feature the authors and the copyright note. This is similar to what mne-python does (see https://github.com/mne-tools/mne-python/blob/main/mne/decoding/time_delaying_ridge.py) and feels much easier to maintain. I think keeping the authors in cpp and h files is important because this is an open-source project after all. The people who mainly worked on these files should be named here.

Next to the preamble, I also changed the following:

  • Removed all /==== separators as I agree with @juangpc that they do not add much value
  • Removed all docs blocks such as Qt includes, inlines, etc.
  • Used //! for single line comments
  • Formatted the file with clang-format -style=LLVM -I connectivity.h, see #905 for detailed discussion on clang-format

An example (libraries/connectivity/connectivity.h):

/**
 * @author Lorenz Esch <[email protected]>
 * @copyright BSD-3-Clause license
 */

#ifndef CONNECTIVITY_H
#define CONNECTIVITY_H

#include "connectivity_global.h"

#include <QSharedPointer>

#include <Eigen/Core>

namespace CONNECTIVITYLIB {

class ConnectivitySettings;
class Network;

/**
 * This class handles the incoming settings and computes the actual connectivity
 * estimation.
 */
class CONNECTIVITYSHARED_EXPORT Connectivity {

public:
  //! Shared pointer type for Connectivity
  typedef QSharedPointer<Connectivity> SPtr;
  //! Const shared pointer type for Connectivity
  typedef QSharedPointer<const Connectivity> ConstSPtr;

  //! Ctor
  explicit Connectivity();

  /**
   * Computes the network based on given connvectivty settings
   *
   * @param connectivitySettings  the connectivity settings
   * @return                      Returns the list with calculated networks for
   * each provided method.
   */
  static QList<Network> calculate(ConnectivitySettings &connectivitySettings);
};

} // namespace CONNECTIVITYLIB

#endif // CONNECTIVITY_H

LorenzE avatar Dec 09 '22 20:12 LorenzE