Skip to content

Preambles in header and source files #908

@LorenzE

Description

@LorenzE

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 Introduce tool for consistent formatting #905 for detailed discussion on clang-format

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

/**
 * @author Lorenz Esch <lesch@mgh.harvard.edu>
 * @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions