Skip to content

Commit 0e56c8e

Browse files
committed
Removed redundant comments for restraints code [ci skip]
1 parent 945674c commit 0e56c8e

File tree

4 files changed

+14
-50
lines changed

4 files changed

+14
-50
lines changed

corelib/src/libs/SireMM/anglerestraints.cpp

+3-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Sire - Molecular Simulation Framework
44
*
5-
* Copyright (C) 2009 Christopher Woods
5+
* Copyright (C) 2025 Christopher Woods
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -98,19 +98,8 @@ AngleRestraint::AngleRestraint(const QList<qint64> &atoms,
9898
: ConcreteProperty<AngleRestraint, Property>(),
9999
_theta0(theta0), _ktheta(ktheta)
100100
{
101-
// Need to think here about validating the angle and force constant values
102-
// if (atoms.count() != 3)
103-
// {
104-
// throw SireError::invalid_arg(QObject::tr(
105-
// "Wrong number of inputs for an Angle restraint. You need to "
106-
// "provide 3 atoms (%1).")
107-
// .arg(atoms.count()),
108-
// // .arg(theta0.count())
109-
// // .arg(ktheta.count()),
110-
// CODELOC);
111-
// }
112-
113-
// make sure that we have 3 distinct atoms
101+
102+
// Make sure that we have 3 distinct atoms
114103
QSet<qint64> distinct;
115104
distinct.reserve(3);
116105

@@ -120,12 +109,6 @@ AngleRestraint::AngleRestraint(const QList<qint64> &atoms,
120109
distinct.insert(atom);
121110
}
122111

123-
// if (distinct.count() != 3)
124-
// throw SireError::invalid_arg(QObject::tr(
125-
// "There is something wrong with the atoms provided. "
126-
// "They should all be unique and all greater than or equal to 0."),
127-
// CODELOC);
128-
129112
atms = atoms.toVector();
130113
}
131114

corelib/src/libs/SireMM/anglerestraints.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Sire - Molecular Simulation Framework
44
*
5-
* Copyright (C) 2009 Christopher Woods
5+
* Copyright (C) 2025 Christopher Woods
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by

corelib/src/libs/SireMM/dihedralrestraints.cpp

+8-27
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Sire - Molecular Simulation Framework
44
*
5-
* Copyright (C) 2009 Christopher Woods
5+
* Copyright (C) 2025 Christopher Woods
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -28,9 +28,9 @@
2828
#include "dihedralrestraints.h"
2929

3030
#include "SireID/index.h"
31-
#include "SireUnits/units.h"
3231
#include "SireStream/datastream.h"
3332
#include "SireStream/shareddatastream.h"
33+
#include "SireUnits/units.h"
3434

3535
#include "SireCAS/errors.h"
3636

@@ -80,37 +80,24 @@ QDataStream &operator>>(QDataStream &ds, DihedralRestraint &dihrest)
8080
return ds;
8181
}
8282

83-
8483
/** Null constructor */
8584
DihedralRestraint::DihedralRestraint()
8685
: ConcreteProperty<DihedralRestraint, Property>(),
8786
_phi0(0), _kphi(0)
8887
{
8988
}
9089

91-
9290
/** Construct a restraint that acts on the angle within the
9391
four atoms 'atom0', 'atom1', 'atom2' 'atom3' (phi == a(0123)),
9492
restraining the angle within these atoms */
9593
DihedralRestraint::DihedralRestraint(const QList<qint64> &atoms,
96-
const SireUnits::Dimension::Angle &phi0,
97-
const SireUnits::Dimension::HarmonicAngleConstant &kphi)
94+
const SireUnits::Dimension::Angle &phi0,
95+
const SireUnits::Dimension::HarmonicAngleConstant &kphi)
9896
: ConcreteProperty<DihedralRestraint, Property>(),
9997
_phi0(phi0), _kphi(kphi)
10098
{
101-
// Need to think here about validating the angle and force constant values
102-
// if (atoms.count() != 3)
103-
// {
104-
// throw SireError::invalid_arg(QObject::tr(
105-
// "Wrong number of inputs for an Angle restraint. You need to "
106-
// "provide 3 atoms (%1).")
107-
// .arg(atoms.count()),
108-
// // .arg(phi0.count())
109-
// // .arg(kphi.count()),
110-
// CODELOC);
111-
// }
112-
113-
// make sure that we have 3 distinct atoms
99+
100+
// Make sure that we have 4 distinct atoms
114101
QSet<qint64> distinct;
115102
distinct.reserve(4);
116103

@@ -120,12 +107,6 @@ DihedralRestraint::DihedralRestraint(const QList<qint64> &atoms,
120107
distinct.insert(atom);
121108
}
122109

123-
// if (distinct.count() != 3)
124-
// throw SireError::invalid_arg(QObject::tr(
125-
// "There is something wrong with the atoms provided. "
126-
// "They should all be unique and all greater than or equal to 0."),
127-
// CODELOC);
128-
129110
atms = atoms.toVector();
130111
}
131112

@@ -301,15 +282,15 @@ DihedralRestraints::DihedralRestraints(const QList<DihedralRestraint> &restraint
301282
}
302283

303284
DihedralRestraints::DihedralRestraints(const QString &name,
304-
const DihedralRestraint &restraint)
285+
const DihedralRestraint &restraint)
305286
: ConcreteProperty<DihedralRestraints, Restraints>(name)
306287
{
307288
if (not restraint.isNull())
308289
r.append(restraint);
309290
}
310291

311292
DihedralRestraints::DihedralRestraints(const QString &name,
312-
const QList<DihedralRestraint> &restraints)
293+
const QList<DihedralRestraint> &restraints)
313294
: ConcreteProperty<DihedralRestraints, Restraints>(name)
314295
{
315296
for (const auto &restraint : restraints)

corelib/src/libs/SireMM/dihedralrestraints.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* Sire - Molecular Simulation Framework
44
*
5-
* Copyright (C) 2009 Christopher Woods
5+
* Copyright (C) 2025 Christopher Woods
66
*
77
* This program is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@ SIREMM_EXPORT QDataStream &operator>>(QDataStream &, SireMM::DihedralRestraints
5050
namespace SireMM
5151
{
5252

53-
/** This class represents a single angle restraint between any three
53+
/** This class represents a single torsion restraint between any four
5454
* atoms in a system
5555
* @author Christopher Woods
5656
*/

0 commit comments

Comments
 (0)