Skip to content

Commit

Permalink
Merge for 1.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Apr 19, 2021
2 parents feabf04 + 09939da commit 32b30e3
Show file tree
Hide file tree
Showing 456 changed files with 31,718 additions and 2,512 deletions.
33 changes: 33 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
engines:
duplication:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
fixme:
enabled: true
radon:
enabled: true
shellcheck:
enabled: true
markdownlint:
enabled: true
ratings:
paths:
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
- "**.php"
- "**.py"
- "**.rb"
- "**.sh"
- "**.md"
exclude_paths:
- test/
- tools/dev_tools/**/*
- src/avrocpp/**/*
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ignore:
- test
- tools/dev_tools
- src/avrocpp
- benchmark
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: build

on: [push, pull_request]

jobs:
build:

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: 2.7
install: ''
flags: '--coverage'
tests: RMF
build: Debug
- os: ubuntu-latest
python-version: 3.9
install: ''
flags: '--coverage'
tests: RMF
build: Debug
- os: ubuntu-latest
python-version: 3.9
install: ''
flags: '--coverage'
tests: RMF
build: Release
- os: ubuntu-latest
python-version: 3.9
install: 'libhdf5-dev liblog4cxx-dev'
flags: '--coverage'
tests: RMF
build: Debug
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq libboost-all-dev swig libc-dbg ${{ matrix.install }}
pip install coverage
- name: Build and test
run: |
mkdir build
cd build
../tools/coverage/setup.py
PYTHONPATH=`pwd`/coverage cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.build }}" -DCMAKE_CXX_FLAGS="${{ matrix.flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.flags }}" -DCMAKE_MODULE_LINKER_FLAGS="${{ matrix.flags }}" -DCMAKE_SHARED_LINKER_FLAGS="${{ matrix.flags }}"
make -j 2
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
ctest -j 2 --output-on-failure -L ${{ matrix.tests }}
- name: Upload coverage to codecov
run: |
cd build
(cd coverage && coverage combine && mv .coverage ..)
bash <(curl -s https://codecov.io/bash)
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

64 changes: 50 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8.12)
project(RMF)

# needs to be in main CMakeLists.txt
enable_testing()

execute_process(COMMAND python setup_git.py
# Default Python3_FIND_STRATEGY to LOCATION
if(POLICY CMP0094)
cmake_policy(SET CMP0094 NEW)
endif(POLICY CMP0094)

# Use new-style variables/escapes
if(POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif(POLICY CMP0053)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_modules)
include(cmake_modules/IMPFindPython.cmake)
imp_find_python()

execute_process(COMMAND ${PYTHON_EXECUTABLE} setup_git.py
RESULT_VARIABLE setup
OUTPUT_VARIABLE toutput
ERROR_VARIABLE error
Expand All @@ -14,15 +28,33 @@ if(NOT ${setup} EQUAL 0)
message(FATAL_ERROR " Failed to run setup_git.py: ${setup}; ${error}")
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_modules)
# Don't deref quoted variables in if()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif(POLICY CMP0054)

# Use new method of handling Ninja custom command byproducts
if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW)
endif(POLICY CMP0058)

# Use consistent SWIG target names across all supported cmake versions
if(POLICY CMP0078)
cmake_policy(SET CMP0078 OLD)
endif(POLICY CMP0078)

# Quiet warning about UseSWIG honoring SWIG_MODULE_NAME (which we don't use)
if(POLICY CMP0086)
cmake_policy(SET CMP0086 NEW)
endif(POLICY CMP0086)

# C++11 can use the boost version
set(Boost_NO_BOOST_CMAKE ON)
find_package(Boost COMPONENTS system filesystem thread program_options iostreams
REQUIRED)

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

if("${HDF5_INCLUDE_DIRS}" MATCHES .*NOTFOUND)
set(RMF_DEPRECATED_BACKENDS 0 CACHE BOOL "Whether to build deprecated backends.")
Expand All @@ -45,19 +77,24 @@ include(cmake_modules/IMPFindCompilerFlags.cmake)

if(RMF_DEPRECATED_BACKENDS)
imp_execute_process("Making RMF/HDF5.h" ${PROJECT_SOURCE_DIR}
COMMAND "python" "${PROJECT_SOURCE_DIR}/tools/dev_tools/make_all_header.py" ${PROJECT_BINARY_DIR}/include/RMF/HDF5.h RMF/HDF5 ${PROJECT_SOURCE_DIR}/include/RMF/HDF5)
COMMAND ${PYTHON_EXECUTABLE}
"${PROJECT_SOURCE_DIR}/tools/dev_tools/make_all_header.py"
${PROJECT_BINARY_DIR}/include/RMF/HDF5.h RMF/HDF5
${PROJECT_SOURCE_DIR}/include/RMF/HDF5)
endif()

imp_execute_process("Making RMF.h" ${PROJECT_SOURCE_DIR}
COMMAND "python" "${PROJECT_SOURCE_DIR}/tools/dev_tools/make_all_header.py" ${PROJECT_BINARY_DIR}/include/RMF.h RMF ${PROJECT_SOURCE_DIR}/include/RMF)

COMMAND ${PYTHON_EXECUTABLE}
"${PROJECT_SOURCE_DIR}/tools/dev_tools/make_all_header.py"
${PROJECT_BINARY_DIR}/include/RMF.h RMF ${PROJECT_SOURCE_DIR}/include/RMF)

message(STATUS "Running setup_cmake.py")
imp_execute_process("Running setup_cmake.py" ${PROJECT_SOURCE_DIR} COMMAND python ${PROJECT_SOURCE_DIR}/tools/dev_tools/setup_cmake.py)

include_directories("${PROJECT_BINARY_DIR}/src"
"${PROJECT_SOURCE_DIR}/src")
imp_execute_process("Running setup_cmake.py" ${PROJECT_SOURCE_DIR}
COMMAND ${PYTHON_EXECUTABLE}
${PROJECT_SOURCE_DIR}/tools/dev_tools/setup_cmake.py)

include_directories(BEFORE "${PROJECT_BINARY_DIR}/include"
"${PROJECT_SOURCE_DIR}/include")

set(RMF_INCLUDE_PATH "" CACHE INTERNAL "" FORCE)

Expand All @@ -68,6 +105,8 @@ if(POLICY CMP0017)
cmake_policy(SET CMP0017 NEW)
endif(POLICY CMP0017)

# Don't set MACOSX_RPATH by default
set(CMAKE_MACOSX_RPATH 0)

if (${Log4CXX_LIBRARY} MATCHES "Log4CXX_LIBRARY-NOTFOUND")
set(RMF_HAS_LOG4CXX "0" CACHE BOOL "Whether to use Log4CXX" FORCE)
Expand Down Expand Up @@ -105,9 +144,6 @@ configure_file (
"${PROJECT_BINARY_DIR}/include/RMF/config.h"
)

include_directories("${PROJECT_BINARY_DIR}/include"
"${PROJECT_SOURCE_DIR}/include")

add_subdirectory(data)
add_subdirectory(include)

Expand Down
14 changes: 13 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Change Log #
Change Log {#changelog}
==========

# 1.2 - 2021-04-19 # {#changelog_1_2}
- A new category of decorators 'provenance' allows information about how the
structure was generated to be added to the file.
- The new RMF::decorator::Reference decorator allows for a node to mark
another node as its reference.
- The new RMF::decorator::ExplicitResolution decorator allows attaching an
explicitly-set resolution to a node. (This allows such values from IMP to
be accurately stored in the file.)

# 1.1 - 2014-03-07 # {#changelog_1_1}
- To be more consisent, RMF::decorator::Domain and
RMF::decorator::Fragment had their access methods modified to
include `residue` in the name.
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# RMF #

[![Build Status](https://travis-ci.org/salilab/rmf.png?branch=develop)](https://travis-ci.org/salilab/rmf)
[![Build Status](https://github.com/salilab/rmf/workflows/build/badge.svg?branch=develop)](https://github.com/salilab/rmf/actions?query=workflow%3Abuild)
[![codecov](https://codecov.io/gh/salilab/rmf/branch/develop/graph/badge.svg)](https://codecov.io/gh/salilab/rmf)
[![Code Climate](https://codeclimate.com/github/salilab/rmf/badges/gpa.svg)](https://codeclimate.com/github/salilab/rmf)

The library provides support for the RMF file format for
storing hierarchical molecular data (such as atomic or coarse grained
representations of proteins), along with markup, including geometry
and score data.

The main documentation is found on the [web site](http://salilab.github.io/rmf).
The main documentation is found on the
[web site](http://integrativemodeling.org/rmf/nightly/doc/).

Copyright 2013 University of California, San Francisco.
Copyright 2007-2021 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
2 changes: 1 addition & 1 deletion benchmark/benchmark_rmf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* \brief Benchmark typical creation, traversal and loading with different RMF
* backends.
*
* Copyright 2007-2013 IMP Inventors. All rights reserved.
* Copyright 2007-2021 IMP Inventors. All rights reserved.
*/

#include <boost/iterator/iterator_facade.hpp>
Expand Down
7 changes: 4 additions & 3 deletions benchmark/benchmark_rmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# \brief Benchmark operations on the RMF from python to see how much overhead
# that adds

from __future__ import print_function
import RMF
import datetime

Expand Down Expand Up @@ -94,14 +95,14 @@ def load(file, nodes):
def benchmark_create(file, type):
start = datetime.datetime.now()
dist = create(file)
print type, "create,", datetime.datetime.now() - start, ",", dist
print(type, "create,", datetime.datetime.now() - start, ",", dist)


def benchmark_traverse(file, type):
start = datetime.datetime.now()
file.set_current_frame(RMF.FrameID(0))
t = traverse(file)
print type, "traverse,", datetime.datetime.now() - start, ",", t
print(type, "traverse,", datetime.datetime.now() - start, ",", t)


def benchmark_load(file, type):
Expand All @@ -112,7 +113,7 @@ def benchmark_load(file, type):
nodes.append(n)
start = datetime.datetime.now()
dist = load(file, nodes)
print type, "load,", datetime.datetime.now() - start, ",", dist
print(type, "load,", datetime.datetime.now() - start, ",", dist)

name = "benchmark_python.rmf"
fh = RMF.create_rmf_file(name)
Expand Down
2 changes: 1 addition & 1 deletion bin/common.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* \file common.h
* Copyright 2007-2013 IMP Inventors. All rights reserved.
* Copyright 2007-2021 IMP Inventors. All rights reserved.
*/

#ifndef RMF_COMMON_H
Expand Down
2 changes: 1 addition & 1 deletion bin/rmf3_dump.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2013 IMP Inventors. All rights reserved.
* Copyright 2007-2021 IMP Inventors. All rights reserved.
*/

#include <boost/shared_ptr.hpp>
Expand Down
3 changes: 2 additions & 1 deletion bin/rmf3_dump.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python

from __future__ import print_function
import avro.schema
from avro.datafile import DataFileReader, DataFileWriter
from avro.io import DatumReader, DatumWriter
import sys

reader = DataFileReader(open(sys.argv[1], "r"), DatumReader())
for user in reader:
print user
print(user)
reader.close()
4 changes: 3 additions & 1 deletion bin/rmf_cat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2013 IMP Inventors. All rights reserved.
* Copyright 2007-2021 IMP Inventors. All rights reserved.
*/

#include <exception>
Expand Down Expand Up @@ -39,7 +39,9 @@ int main(int argc, char** argv) {
for (unsigned int i = 0; i < inputs.size(); ++i) {
RMF::FileConstHandle rh = RMF::open_rmf_file_read_only(inputs[i]);
if (i == 0) {
RMF::clone_file_info(rh, orh); // creator etc. (not essential)
RMF::clone_hierarchy(rh, orh);
RMF::clone_static_frame(rh, orh);
}
orh.set_description(orh.get_description() + "\n" + rh.get_description());
RMF_FOREACH(RMF::FrameID ni, rh.get_frames()) {
Expand Down
Loading

0 comments on commit 32b30e3

Please sign in to comment.