Skip to content

Commit 1e1b416

Browse files
committed
Merge branch 'devel'
2 parents 5e3937a + 64edfe8 commit 1e1b416

37 files changed

+466
-327
lines changed

README.rst

+13-13
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ Installation
3737
The easiest way to install Sire is using our `conda channel <https://anaconda.org/openbiosim/repo>`__.
3838
Sire is built using dependencies from `conda-forge <https://conda-forge.org/>`__,
3939
so please ensure that the channel takes strict priority. We recommend using
40-
`mambaforge <https://github.com/conda-forge/miniforge#mambaforge>`__.
40+
`miniforge3 <https://github.com/conda-forge/miniforge#miniforge3>`__.
4141

4242
To create a new environment:
4343

4444
.. code-block:: bash
4545
46-
mamba create -n openbiosim "python<3.11"
47-
mamba activate openbiosim
48-
mamba install -c conda-forge -c openbiosim sire
46+
conda create -n openbiosim "python<3.12"
47+
conda activate openbiosim
48+
conda install -c conda-forge -c openbiosim sire
4949
5050
To install the latest development version you can use:
5151

5252
.. code-block:: bash
5353
54-
mamba create -n openbiosim-dev "python<3.11"
55-
mamba activate openbiosim-dev
56-
mamba install -c conda-forge -c openbiosim/label/dev sire
54+
conda create -n openbiosim-dev "python<3.12"
55+
conda activate openbiosim-dev
56+
conda install -c conda-forge -c openbiosim/label/dev sire
5757
5858
However, as you are here, it is likely you want to download the latest,
5959
greatest version of the code, which you will need to compile. To compile
@@ -65,32 +65,32 @@ First, you need to create and activate a conda environment, e.g.
6565

6666
.. code-block:: bash
6767
68-
mamba create -n openbiosim-dev "python<3.11"
69-
mamba activate openbiosim-dev
68+
conda create -n openbiosim-dev "python<3.12"
69+
conda activate openbiosim-dev
7070
7171
Next, you need to install the Sire build dependencies.
7272

7373
.. code-block:: bash
7474
75-
mamba install cmake pip-requirements-parser
75+
conda install cmake pip-requirements-parser
7676
7777
You will also need to install compilers, e.g. on Linux use
7878

7979
.. code-block:: bash
8080
81-
mamba install gcc gxx
81+
conda install gcc gxx
8282
8383
on MacOS use
8484

8585
.. code-block:: bash
8686
87-
mamba install clang clangxx
87+
conda install clang clangxx
8888
8989
and on Windows use
9090

9191
.. code-block:: bash
9292
93-
mamba install conda-build
93+
conda install conda-build
9494
9595
Next, you can clone the sire source code and compile and install sire::
9696

SECURITY.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
As we have limited resource, we only support the latest major release
66
of sire with security updates. For example, if the current version
7-
is 2023.1.0, then only versions 2023.1.0 to 2023.1.X wil have updates,
8-
which will be released as 2023.1.X+1.
7+
is 2023.5.0, then only versions 2023.5.0 to 2023.5.X wil have updates,
8+
which will be released as 2023.5.X+1.
99

1010
| Version | Supported |
1111
| ------- | ------------------ |
12-
| 2023.1.x | :white_check_mark: |
13-
| < 2023.1.x| :x: |
12+
| 2023.5.x | :white_check_mark: |
13+
| < 2023.5.x| :x: |
1414

1515
## Reporting a Vulnerability
1616

corelib/src/libs/SireCAS/lambdaschedule.cpp

+74-22
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ QDataStream &operator<<(QDataStream &ds, const LambdaSchedule &schedule)
5656
return ds;
5757
}
5858

59+
Symbol LambdaSchedule::lambda_symbol("λ");
60+
Symbol LambdaSchedule::initial_symbol("initial");
61+
Symbol LambdaSchedule::final_symbol("final");
62+
63+
Expression LambdaSchedule::default_morph_equation = (1.0 - LambdaSchedule::lam()) * LambdaSchedule::initial() +
64+
LambdaSchedule::lam() * LambdaSchedule::final();
65+
5966
QDataStream &operator>>(QDataStream &ds, LambdaSchedule &schedule)
6067
{
6168
VersionID v = readHeader(ds, r_schedule);
@@ -68,6 +75,21 @@ QDataStream &operator>>(QDataStream &ds, LambdaSchedule &schedule)
6875
schedule.lever_names >> schedule.stage_names >>
6976
schedule.default_equations >> schedule.stage_equations >>
7077
static_cast<Property &>(schedule);
78+
79+
for (auto &expression : schedule.default_equations)
80+
{
81+
if (expression == LambdaSchedule::default_morph_equation)
82+
expression = LambdaSchedule::default_morph_equation;
83+
}
84+
85+
for (auto &stage_equations : schedule.stage_equations)
86+
{
87+
for (auto &expression : stage_equations)
88+
{
89+
if (expression == LambdaSchedule::default_morph_equation)
90+
expression = LambdaSchedule::default_morph_equation;
91+
}
92+
}
7193
}
7294
else
7395
throw version_error(v, "1", r_schedule, CODELOC);
@@ -203,10 +225,6 @@ LambdaSchedule LambdaSchedule::charge_scaled_morph(double scale)
203225
return l;
204226
}
205227

206-
Symbol LambdaSchedule::lambda_symbol("λ");
207-
Symbol LambdaSchedule::initial_symbol("initial");
208-
Symbol LambdaSchedule::final_symbol("final");
209-
210228
/** Return the symbol used to represent the :lambda: coordinate.
211229
* This symbol is used to represent the per-stage :lambda:
212230
* variable that goes from 0.0-1.0 within that stage.
@@ -438,8 +456,7 @@ void LambdaSchedule::clear()
438456
*/
439457
void LambdaSchedule::addMorphStage(const QString &name)
440458
{
441-
this->addStage(name, (this->lam() * this->final()) +
442-
((1 - this->lam()) * this->initial()));
459+
this->addStage(name, default_morph_equation);
443460
}
444461

445462
/** Append a morph stage onto this schedule. The morph stage is a
@@ -501,9 +518,14 @@ void LambdaSchedule::addChargeScaleStages(double scale)
501518
void LambdaSchedule::prependStage(const QString &name,
502519
const SireCAS::Expression &equation)
503520
{
521+
auto e = equation;
522+
523+
if (e == default_morph_equation)
524+
e = default_morph_equation;
525+
504526
if (this->nStages() == 0)
505527
{
506-
this->appendStage(name, equation);
528+
this->appendStage(name, e);
507529
return;
508530
}
509531

@@ -514,7 +536,7 @@ void LambdaSchedule::prependStage(const QString &name,
514536
CODELOC);
515537

516538
this->stage_names.prepend(name);
517-
this->default_equations.prepend(equation);
539+
this->default_equations.prepend(e);
518540
this->stage_equations.prepend(QHash<QString, Expression>());
519541
}
520542

@@ -532,8 +554,13 @@ void LambdaSchedule::appendStage(const QString &name,
532554
.arg(name),
533555
CODELOC);
534556

557+
auto e = equation;
558+
559+
if (e == default_morph_equation)
560+
e = default_morph_equation;
561+
535562
this->stage_names.append(name);
536-
this->default_equations.append(equation);
563+
this->default_equations.append(e);
537564
this->stage_equations.append(QHash<QString, Expression>());
538565
}
539566

@@ -546,14 +573,19 @@ void LambdaSchedule::insertStage(int i,
546573
const QString &name,
547574
const SireCAS::Expression &equation)
548575
{
576+
auto e = equation;
577+
578+
if (e == default_morph_equation)
579+
e = default_morph_equation;
580+
549581
if (i == 0)
550582
{
551-
this->prependStage(name, equation);
583+
this->prependStage(name, e);
552584
return;
553585
}
554586
else if (i >= this->nStages())
555587
{
556-
this->appendStage(name, equation);
588+
this->appendStage(name, e);
557589
return;
558590
}
559591

@@ -564,7 +596,7 @@ void LambdaSchedule::insertStage(int i,
564596
CODELOC);
565597

566598
this->stage_names.insert(i, name);
567-
this->default_equations.insert(i, equation);
599+
this->default_equations.insert(i, e);
568600
this->stage_equations.insert(i, QHash<QString, Expression>());
569601
}
570602

@@ -605,7 +637,12 @@ int LambdaSchedule::find_stage(const QString &stage) const
605637
void LambdaSchedule::setDefaultEquation(const QString &stage,
606638
const Expression &equation)
607639
{
608-
this->default_equations[this->find_stage(stage)] = equation;
640+
auto e = equation;
641+
642+
if (e == default_morph_equation)
643+
e = default_morph_equation;
644+
645+
this->default_equations[this->find_stage(stage)] = e;
609646
}
610647

611648
/** Set the custom equation used to control the specified
@@ -617,12 +654,17 @@ void LambdaSchedule::setEquation(const QString &stage,
617654
const QString &lever,
618655
const Expression &equation)
619656
{
657+
auto e = equation;
658+
659+
if (e == default_morph_equation)
660+
e = default_morph_equation;
661+
620662
auto &lever_expressions = this->stage_equations[this->find_stage(stage)];
621663

622664
if (not this->lever_names.contains(lever))
623665
this->addLever(lever);
624666

625-
lever_expressions[lever] = equation;
667+
lever_expressions[lever] = e;
626668
}
627669

628670
/** Remove the custom equation for the specified `lever` at the
@@ -875,21 +917,31 @@ QVector<double> LambdaSchedule::morph(const QString &lever_name,
875917
const auto equation = this->stage_equations[stage].value(
876918
lever_name, this->default_equations[stage]);
877919

878-
Values input_values = this->constant_values;
879-
input_values.set(this->lam(), std::get<1>(resolved));
880-
881920
QVector<double> morphed(nparams);
882-
883921
auto morphed_data = morphed.data();
884922
const auto initial_data = initial.constData();
885923
const auto final_data = final.constData();
886924

887-
for (int i = 0; i < nparams; ++i)
925+
if (equation == default_morph_equation)
888926
{
889-
input_values.set(this->initial(), initial_data[i]);
890-
input_values.set(this->final(), final_data[i]);
927+
for (int i = 0; i < nparams; ++i)
928+
{
929+
morphed_data[i] = (1.0 - lambda_value) * initial_data[i] +
930+
lambda_value * final_data[i];
931+
}
932+
}
933+
else
934+
{
935+
Values input_values = this->constant_values;
936+
input_values.set(this->lam(), std::get<1>(resolved));
937+
938+
for (int i = 0; i < nparams; ++i)
939+
{
940+
input_values.set(this->initial(), initial_data[i]);
941+
input_values.set(this->final(), final_data[i]);
891942

892-
morphed_data[i] = equation(input_values);
943+
morphed_data[i] = equation(input_values);
944+
}
893945
}
894946

895947
return morphed;

corelib/src/libs/SireCAS/lambdaschedule.h

+3
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ namespace SireCAS
204204

205205
/** The symbol used to represent the final value */
206206
static SireCAS::Symbol final_symbol;
207+
208+
/** The default morph equation */
209+
static SireCAS::Expression default_morph_equation;
207210
};
208211

209212
}

corelib/src/libs/SireIO/pdbx.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ PDBx::PDBx(const SireSystem::System &system, const PropertyMap &map) : ConcreteP
149149
throw SireError::unsupported(
150150
"No PDBx writer function has been registered. You need to "
151151
"install a library to write PDBx/mmCIF files, e.g. gemmi. "
152-
"Do this by running 'mamba install -c conda-forge gemmi' "
152+
"Do this by running 'conda install -c conda-forge gemmi' "
153153
"and then re-running this script.",
154154
CODELOC);
155155

@@ -274,7 +274,7 @@ QVector<QString> PDBx::toLines() const
274274
throw SireError::unsupported(
275275
"No PDBx writer function has been registered. You need to "
276276
"install a library to write PDBx/mmCIF files, e.g. gemmi. "
277-
"Do this by running 'mamba install -c conda-forge gemmi' "
277+
"Do this by running 'conda install -c conda-forge gemmi' "
278278
"and then re-running this script.",
279279
CODELOC);
280280

@@ -321,7 +321,7 @@ void PDBx::parseLines(const PropertyMap &map)
321321
throw SireError::unsupported(
322322
"No PDBx reader function has been registered. You need to "
323323
"install a library to read PDBx/mmCIF files, e.g. gemmi. "
324-
"Do this by running 'mamba install -c conda-forge gemmi' "
324+
"Do this by running 'conda install -c conda-forge gemmi' "
325325
"and then re-running this script.",
326326
CODELOC);
327327

doc/source/acknowledgements.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ does not affect :mod:`sire`. CMake is excellent. You can read more about it
119119
Anaconda
120120
---------
121121

122-
:mod:`sire` uses Anaconda Python (specifically mambaforge and conda-forge) to
122+
:mod:`sire` uses Anaconda Python (specifically miniforge and conda-forge) to
123123
simplify the management and installation of Python and the various
124124
modules on which :mod:`sire` depends.
125125

126-
Anaconda (and miniconda) are distributed as
126+
Anaconda (and miniforge) are distributed as
127127
`open source projects <https://www.continuum.io/open-source-core-modern-software>`__.
128128
As :mod:`sire` does not explicitly link with them, the license is not an issue.
129129
You can find out more about Anaconda `from here <https://www.continuum.io/>`__.

doc/source/changelog.rst

+17-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ Development was migrated into the
1212
`OpenBioSim <https://github.com/openbiosim>`__
1313
organisation on `GitHub <https://github.com/openbiosim/sire>`__.
1414

15+
`2023.5.1 <https://github.com/openbiosim/sire/compare/2023.5.0...2023.5.1>`__ - January 2024
16+
--------------------------------------------------------------------------------------------
17+
18+
* Added a ``.dynamics().step(num_steps)`` function to make it easier to quickly run
19+
steps of OpenMM dynamics with minimal overhead (this directly called ``Integrator.step()``)
20+
21+
* Some optimisations to the OpenMM layer that make full use of the
22+
experimental "updateSomeParametersInContext" functions.
23+
24+
* Updated gemmi to 0.6.4, so that it can be default-enabled on all supported platforms.
25+
As part of this, had to change the version of the compilers used on Windows and Linux
26+
to make the conda packages. Windows now uses Visual Studio 2022 instead of 2017,
27+
and Linux now uses GCC 12.3.0 instead of GCC 13.
28+
1529
`2023.5.0 <https://github.com/openbiosim/sire/compare/2023.4.2...2023.5.0>`__ - December 2023
1630
---------------------------------------------------------------------------------------------
1731

@@ -918,14 +932,14 @@ Here is the changelog for this stage of development.
918932
only pythonize the C++ layer, and avoid the circular dependencies
919933
that were causing random import errors (particularly on Windows).
920934

921-
[2023.0.2] December 2023: Fix multiple distance restraint bug in SOMD
935+
[2023.0.2] December 2022: Fix multiple distance restraint bug in SOMD
922936
(@fjclark). Add support for PME FEP with SOMD and fix
923937
associated bugs (@halx, @jmichel80). Fix CI issues so that
924938
PRs use the correct URL when triggered by external forks.
925939
Exclude dummy atoms when repartitioning hydrogen masses.
926940
Deprecate py37.
927941

928-
[2023.0.1] November 2023: Improve handling of HETATM and TER records in
942+
[2023.0.1] November 2022: Improve handling of HETATM and TER records in
929943
PDB files. Fix SOMD selection issues following update to the
930944
2023 API. Fix writing of steps to SOMD simfile.dat (@fjclark).
931945
Throw exception when CHAMBER format AMBER topology files are
@@ -940,7 +954,7 @@ Here is the changelog for this stage of development.
940954
order. Ensure Sire is built against packages with the "dev"
941955
label.
942956

943-
[2023.0.0] July 2023 - Updated Sire's API to a more pythonic style.
957+
[2023.0.0] July 2022 - Updated Sire's API to a more pythonic style.
944958
Module names are in lower case, e.g. `import Sire` becomes
945959
`import sire`, or `import sire as sr`. Functions are in
946960
underscore_case. This change is not backwards compatible. To

0 commit comments

Comments
 (0)