Skip to content

Commit

Permalink
Merge for 1.6.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed May 13, 2024
2 parents c4a32b0 + 7d7ea59 commit fa92a33
Show file tree
Hide file tree
Showing 37 changed files with 413 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (Linux)
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ find_package(Boost COMPONENTS system filesystem thread program_options iostreams
REQUIRED)

include(FindHDF5)
find_package(HDF5 1.8)
find_package(HDF5)

if("${HDF5_INCLUDE_DIRS}" MATCHES .*NOTFOUND)
set(RMF_DEPRECATED_BACKENDS 0 CACHE BOOL "Whether to build deprecated backends.")
Expand Down Expand Up @@ -140,7 +140,7 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
# Version information
set (RMF_VERSION_MAJOR 1)
set (RMF_VERSION_MINOR 6)
set (RMF_VERSION_MICRO 0)
set (RMF_VERSION_MICRO 1)
math (EXPR RMF_VERSION "${RMF_VERSION_MAJOR} * 100000 + ${RMF_VERSION_MINOR} * 100 + ${RMF_VERSION_MICRO}")

set(RMF_SOVERSION "${RMF_VERSION_MAJOR}.${RMF_VERSION_MINOR}" CACHE INTERNAL "" FORCE)
Expand Down
10 changes: 9 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
Change Log {#changelog}
==========

# 1.6.1 - 2024-05-13 # {#changelog_1_6_1}
- .deb packages for RMF for Ubuntu are now provided via the
[Ubuntu PPA](https://launchpad.net/~salilab/+archive/ubuntu/ppa) mechanism.
- `rmf_cat` now checks that all of the files it has been asked to concatenate
have the same structure and static frame, and exits with an error if they
don't. A new `--force` option is provided to override this check.
- Bugfix: fixes to build with Boost 1.85

# 1.6.0 - 2023-12-14 # {#changelog_1_6_0}
- RPM packages for IMP for RedHat Linux (and clones such as Alma or Rocky)
- RPM packages for RMF for RedHat Linux (and clones such as Alma or Rocky)
and for Fedora are now provided by the
[COPR project](https://copr.fedorainfracloud.org/coprs/salilab/salilab/).
- RMF::decorator::Chain can now store a per-chain sequence offset and UniProt
Expand Down
4 changes: 4 additions & 0 deletions benchmark/benchmark_rmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
*/

#include <boost/iterator/iterator_facade.hpp>
#include <boost/version.hpp>
#include <boost/filesystem/operations.hpp>
#if BOOST_VERSION >= 107200
#include <boost/filesystem/directory.hpp>
#endif
#include <exception>
#include <iostream>
#include <chrono>
Expand Down
25 changes: 24 additions & 1 deletion bin/rmf_cat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,42 @@ std::string output;
}
int main(int argc, char** argv) {
try {
options.add_options()("force,f",
"Combine files even if they have different "
"structure or static frames.");
positional_options.add_options()(
"input-files,i",
boost::program_options::value<std::vector<std::string> >(&inputs),
"input rmf file");
positional_names.emplace_back("input_1.rmf input_2.rmf ... output.rmf");
positional_options_description.add("input-files", -1);
process_options(argc, argv);
boost::program_options::variables_map vm(process_options(argc, argv));

if (inputs.size() < 3) {
print_help_and_exit(argv);
}

output = inputs.back();
inputs.pop_back();
bool force = vm.count("force");
if (!force && inputs.size() > 1) {
RMF::FileConstHandle rh1 = RMF::open_rmf_file_read_only(inputs[0]);
for (unsigned int i = 1; i < inputs.size(); ++i) {
RMF::FileConstHandle rh2 = RMF::open_rmf_file_read_only(inputs[i]);
if (!RMF::get_equal_structure(rh1, rh2, true)) {
std::cerr << inputs[0] << " and " << inputs[i]
<< " have different structure, cannot concatenate "
<< "without --force" << std::endl;
exit(1);
}
if (!RMF::get_equal_static_values(rh1, rh2)) {
std::cerr << inputs[0] << " and " << inputs[i]
<< " have different static frames, cannot concatenate "
<< "without --force" << std::endl;
exit(1);
}
}
}
RMF::FileHandle orh = RMF::create_rmf_file(output);
orh.set_producer("rmf_cat");
for (unsigned int i = 0; i < inputs.size(); ++i) {
Expand Down
1 change: 1 addition & 0 deletions doc/Executables.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and how much they are used.

Combine two or more rmf files.
Usage: ./bin/rmf_cat input_1.rmf input_2.rmf ... output.rmf
-f [ --force ] Combine files even if they have different structure or static frame.
-h [ --help ] Get help on command line arguments.
-v [ --verbose ] Produce more output.
--hdf5-errors Show hdf5 errors.
Expand Down
8 changes: 7 additions & 1 deletion doc/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ or on a Mac with [Homebrew](https://brew.sh/), install with

brew tap salilab/salilab; brew install rmf

or on a Fedora or RedHat Enterprise Linux system, install with
or on a Fedora or RedHat Enterprise Linux system, install via
[COPR](https://copr.fedorainfracloud.org/coprs/salilab/salilab/) with

dnf copr enable salilab/salilab; dnf install RMF

or on an Ubuntu LTS system, install via
[PPA](https://launchpad.net/~salilab/+archive/ubuntu/ppa) with

apt install software-properties-common; add-apt-repository ppa:salilab/ppa; apt install rmf

IMP: Download an IMP binary (which includes RMF) from the
[IMP download page](https://integrativemodeling.org/download.html).

Expand Down
2 changes: 1 addition & 1 deletion doc/Main.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See
Also see the [rmf examples](https://github.com/salilab/rmf_examples) repository
for examples of interesting or problematic RMF files.

Copyright 2007-2023 IMP Inventors.
Copyright 2007-2024 IMP Inventors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions include/RMF/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <boost/range/end.hpp>
#include <type_traits>
#include <array>
#include <boost/static_assert.hpp>
#include <algorithm>

RMF_ENABLE_WARNINGS
Expand Down Expand Up @@ -61,13 +60,13 @@ class Vector
RMF_CXX11_DEFAULT_COPY_CONSTRUCTOR(Vector);

Vector(float x, float y, float z) {
BOOST_STATIC_ASSERT(D == 3);
static_assert(D == 3, "Constructor only valid for Vector3");
P::operator[](0) = x;
P::operator[](1) = y;
P::operator[](2) = z;
}
Vector(float x, float y, float z, float q) {
BOOST_STATIC_ASSERT(D == 4);
static_assert(D == 4, "Constructor only valid for Vector4");
P::operator[](0) = x;
P::operator[](1) = y;
P::operator[](2) = z;
Expand Down
4 changes: 2 additions & 2 deletions include/RMF/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class RMFEXPORT Exception : public virtual std::exception,

/** Use this instead of the more standard what() to get the
message as what() presents issues for memory management
with dynamically generated messages like. */
with dynamically generated messages. */
RMFEXPORT std::string get_message(const Exception& e);

/** Usage exceptions are thrown when the library is misused in some way,
e.g., an out of bounds element is requested from a collection. In general
when these are throw, the failed operation should have been cleanly
when these are thrown, the failed operation should have been cleanly
aborted without changing the file.
*/
class RMFEXPORT UsageException : public Exception {
Expand Down
6 changes: 3 additions & 3 deletions include/RMF/internal/swig_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ struct ValueOrObject {

template <class T>
struct ConvertAllBase {
BOOST_STATIC_ASSERT(!is_pointer<T>::value);
static_assert(!is_pointer<T>::value, "is a pointer");
template <class SwigData>
static bool get_is_cpp_object(PyObject* o, SwigData st) {
void* vp;
Expand All @@ -129,7 +129,7 @@ struct ConvertAllBase {

template <class T>
struct ConvertValueBase : public ConvertAllBase<T> {
BOOST_STATIC_ASSERT(!is_pointer<T>::value);
static_assert(!is_pointer<T>::value, "is a pointer");
template <class SwigData>
static const T& get_cpp_object(PyObject* o, SwigData st) {
void* vp;
Expand Down Expand Up @@ -175,7 +175,7 @@ struct Convert : public ConvertValueBase<T> {
template <class T, class VT, class ConvertVT>
struct ConvertSequenceHelper {
typedef typename ValueOrObject<VT>::type V;
BOOST_STATIC_ASSERT(!is_pointer<T>::value);
static_assert(!is_pointer<T>::value, "is a pointer");
template <class SwigData>
static bool get_is_cpp_object(PyObject* in, SwigData st) {
if (!in || !PySequence_Check(in)) {
Expand Down
5 changes: 2 additions & 3 deletions src/avrocpp/api/AvroParse.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define avro_AvroParse_hh__

#include "Config.hh"
#include <boost/static_assert.hpp>
#include "AvroTraits.hh"
#include "ResolvingReader.hh"

Expand Down Expand Up @@ -48,12 +47,12 @@ void parse(ResolvingReader &p, T &val) {

template <typename Reader, typename T>
void parse(Reader &p, T &val, const boost::false_type &) {
BOOST_STATIC_ASSERT(sizeof(T) == 0);
static_assert(sizeof(T) == 0, "val should be empty");
}

template <typename Reader, typename T>
void translatingParse(Reader &p, T &val, const boost::false_type &) {
BOOST_STATIC_ASSERT(sizeof(T) == 0);
static_assert(sizeof(T) == 0, "val should be empty");
}

// @{
Expand Down
3 changes: 1 addition & 2 deletions src/avrocpp/api/AvroSerialize.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#define avro_AvroSerialize_hh__

#include "Config.hh"
#include <boost/static_assert.hpp>
#include "AvroTraits.hh"

/// \file
Expand All @@ -43,7 +42,7 @@ void serialize(Writer &s, const T &val) {

template <typename Writer, typename T>
void serialize(Writer &s, const T &val, const boost::false_type &) {
BOOST_STATIC_ASSERT(sizeof(T) == 0);
static_assert(sizeof(T) == 0, "val should be empty");
}

/// The remainder of the file includes default implementations for serializable
Expand Down
2 changes: 1 addition & 1 deletion src/avrocpp/api/buffer/BufferReader.hh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class AVRO_DECL BufferReader : private boost::noncopyable {
/// An uninstantiable function, this is if boost::is_fundamental check fails
template <typename T>
bool read(T &val, const boost::false_type &) {
BOOST_STATIC_ASSERT(sizeof(T) == 0);
static_assert(sizeof(T) == 0, "val should be empty");
return false;
}

Expand Down
3 changes: 1 addition & 2 deletions src/avrocpp/api/buffer/detail/BufferDetail.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <memory>
#include <boost/shared_array.hpp>
#include <boost/static_assert.hpp>
#include <boost/function.hpp>
#include <boost/utility.hpp>
#ifdef HAVE_BOOST_ASIO
Expand Down Expand Up @@ -325,7 +324,7 @@ class BufferImpl : boost::noncopyable {
/// and will compile-time assert.
template <typename T>
void writeTo(T val, const boost::false_type &) {
BOOST_STATIC_ASSERT(sizeof(T) == 0);
static_assert(sizeof(T) == 0, "val should be empty");
}

/// Write a block of data to the buffer, adding new chunks if necessary.
Expand Down
8 changes: 4 additions & 4 deletions src/avrocpp/impl/Resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ class ResolverFactory : private boost::noncopyable {
&ResolverFactory::constructCompound<UnionParser, UnionSkipper>,
&ResolverFactory::constructCompound<FixedParser, FixedSkipper>};

BOOST_STATIC_ASSERT((sizeof(funcs) / sizeof(BuilderFunc)) ==
(AVRO_NUM_TYPES));
static_assert((sizeof(funcs) / sizeof(BuilderFunc)) ==
(AVRO_NUM_TYPES), "function table size mismatch");

BuilderFunc func = funcs[currentWriter->type()];
assert(func);
Expand Down Expand Up @@ -594,8 +594,8 @@ class ResolverFactory : private boost::noncopyable {
&ResolverFactory::constructCompoundSkipper<UnionSkipper>,
&ResolverFactory::constructCompoundSkipper<FixedSkipper>};

BOOST_STATIC_ASSERT((sizeof(funcs) / sizeof(BuilderFunc)) ==
(AVRO_NUM_TYPES));
static_assert((sizeof(funcs) / sizeof(BuilderFunc)) ==
(AVRO_NUM_TYPES), "function table size mismatch");

BuilderFunc func = funcs[currentWriter->type()];
assert(func);
Expand Down
7 changes: 3 additions & 4 deletions src/avrocpp/impl/Types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <iostream>
#include <string>
#include <boost/static_assert.hpp>
#include "Types.hh"

namespace internal_avro {
Expand All @@ -28,16 +27,16 @@ const std::string typeToString[] = {
"string", "bytes", "int", "long", "float", "double", "boolean", "null",
"record", "enum", "array", "map", "union", "fixed", "symbolic"};

BOOST_STATIC_ASSERT((sizeof(typeToString) / sizeof(std::string)) ==
(AVRO_NUM_TYPES + 1));
static_assert((sizeof(typeToString) / sizeof(std::string)) ==
(AVRO_NUM_TYPES + 1), "type table size mismatch");

} // namespace strings

// this static assert exists because a 32 bit integer is used as a bit-flag for
// each type,
// and it would be a problem for this flag if we ever supported more than 32
// types
BOOST_STATIC_ASSERT(AVRO_NUM_TYPES < 32);
static_assert(AVRO_NUM_TYPES < 32, "flags should fit in 32-bit");

const std::string &toString(Type type) {
static std::string undefinedType = "Undefined type";
Expand Down
9 changes: 4 additions & 5 deletions src/avrocpp/impl/Validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* limitations under the License.
*/

#include <boost/static_assert.hpp>

#include "Validator.hh"
#include "ValidSchema.hh"
#include "NodeImpl.hh"
Expand Down Expand Up @@ -141,8 +139,8 @@ void Validator::doAdvance() {
&Validator::enumAdvance, &Validator::countingAdvance,
&Validator::countingAdvance, &Validator::unionAdvance,
&Validator::fixedAdvance};
BOOST_STATIC_ASSERT((sizeof(funcs) / sizeof(AdvanceFunc)) ==
(AVRO_NUM_TYPES));
static_assert((sizeof(funcs) / sizeof(AdvanceFunc)) ==
(AVRO_NUM_TYPES), "function table size mismatch");

expectedTypesFlag_ = 0;
// loop until we encounter a next expected type, or we've exited all compound
Expand Down Expand Up @@ -199,7 +197,8 @@ void Validator::setupFlag(Type type) {
typeToFlag(AVRO_ENUM), typeToFlag(AVRO_ARRAY),
typeToFlag(AVRO_MAP), typeToFlag(AVRO_UNION),
typeToFlag(AVRO_FIXED)};
BOOST_STATIC_ASSERT((sizeof(flags) / sizeof(flag_t)) == (AVRO_NUM_TYPES));
static_assert((sizeof(flags) / sizeof(flag_t)) == (AVRO_NUM_TYPES),
"flags table size mismatch");

expectedTypesFlag_ = flags[type];
}
Expand Down
4 changes: 4 additions & 0 deletions src/backend/deprecated_avro/MultipleAvroFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
*
*/

#include <boost/version.hpp>
#include <boost/filesystem/operations.hpp>
#if BOOST_VERSION >= 107200
#include <boost/filesystem/directory.hpp>
#endif
#include <boost/filesystem/path.hpp>
#include <boost/functional/hash/hash.hpp>
#include <boost/iterator/iterator_facade.hpp>
Expand Down
8 changes: 8 additions & 0 deletions test/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def test_get_global_coordinates_particle_no_coords(self):
expected_coord = numpy.array([[1., 2., 3.]])
self.assertLess(numpy.linalg.norm(coord - expected_coord), 1e-4)

@unittest.skipIf(RMF.RMF_HAS_NUMPY, "We have numpy")
def test_numpy_is_missing(self):
"""Check that the numpy library is missing"""
# This test is a noop; it is here simply so that not all tests are
# skipped when numpy is missing (Python 3.12 flags all tests being
# skipped as an error)
pass


if __name__ == '__main__':
unittest.main()
Loading

0 comments on commit fa92a33

Please sign in to comment.