From ba9ba9efa837caaa5083a5ffeb32ada7679e0958 Mon Sep 17 00:00:00 2001 From: Daniel Nachbaur Date: Tue, 14 Jun 2016 11:28:17 +0200 Subject: [PATCH] Cleanup deprecated enums and functions, doxygen tweaks --- CMakeLists.txt | 1 + README.md | 16 +++---- brion/blueConfig.h | 4 +- brion/compartmentReport.cpp | 20 --------- brion/compartmentReport.h | 29 +------------ brion/compartmentReportPlugin.h | 2 + brion/enums.h | 70 +----------------------------- brion/plugin/compartmentReportBinary.cpp | 1 + brion/plugin/spikeReportBinary.cpp | 2 + brion/plugin/spikeReportFile.h | 1 + brion/plugin/spikeReportSimpleStreamer.cpp | 2 + doc/Changelog.md | 11 ++++- tests/compartmentReport.cpp | 3 +- tests/spikeReport.cpp | 1 + 14 files changed, 33 insertions(+), 130 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b314d6b..7dcafd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,4 +48,5 @@ include(CPackConfig) set(DOXYGEN_MAINPAGE_MD README.md) set(DOXYGEN_EXPAND_AS_DEFINED "BRAIN_API BRION_API") set(DOXYGEN_EXTRA_INPUT "${PROJECT_SOURCE_DIR}/README.md ${CMAKE_INSTALL_PREFIX}/include/brain") +set(DOXYGEN_PREDEFINED_MACROS "BRAIN_API:=") include(DoxygenRule) diff --git a/README.md b/README.md index 54b2a0a..11b3021 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ readers and writers intended for low level access to the data model. The latter is a set of higher level classes that wrap low level data objects with a more user friendly API. -# IO library +## IO library This is the core library provided by Brion. It includes classes for reading and writing files which store the Blue Brain data model. @@ -34,26 +34,26 @@ and writing files which store the Blue Brain data model. * H5 Synapses data (brion::SynapseSummary, brion::Synapse) * Target (brion::Target) * BBP binary meshes (brion::Mesh) - * BBP H5 morphologies and SWC morphologies (brion::Morphology and - brion::morphologies) + * BBP H5 morphologies and SWC morphologies (brion::Morphology) * Compartment reports (brion::CompartmentReport) * Spike reports (brion::SpikeReport) * Fast and low-overhead write access to: * Compartment reports (brion::CompartmentReport) * BBP binary meshes (brion::Mesh) * BBP H5 morphologies (brion::Morphology) + * Spike reports (brion::SpikeReport) * Basic [data types](@ref brion/types.h) to work with the loaded data using - [vmmlib](http://vmml.github.io/vmmlib), - [Lunchbox](http://eyescale.github.io/Lunchbox-1.8/index.html), - [Boost](http://www.boost.org/doc/libs). + [Boost](http://www.boost.org/doc/libs), + [Lunchbox](http://eyescale.github.io/Lunchbox-1.14/index.html), + [vmmlib](http://eyescale.github.io/vmmlib-1.11/index.html). ## High level library The higher level library is called Brain and it provides: -* A circuit class to facilitate loading information about cells and +* brain::Circuit to facilitate loading information about cells and morphologies in local and global circuit coordinates. -* A morphology class with higher level functions to deal with morphologies. +* brain::neuron::Morphology with higher level functions to deal with morphologies. # Building {#Building} diff --git a/brion/blueConfig.h b/brion/blueConfig.h index f8645b2..24fb77f 100644 --- a/brion/blueConfig.h +++ b/brion/blueConfig.h @@ -108,7 +108,7 @@ class BlueConfig : public boost::noncopyable */ BRION_API URI getCircuitSource() const; - /* + /** * @return the URI to the location of synapse nrn files. * @version 1.7 */ @@ -132,7 +132,7 @@ class BlueConfig : public boost::noncopyable */ BRION_API URI getSpikeSource() const; - /* + /** * @return the URIs to the locations of the target files. * @version 1.8 */ diff --git a/brion/compartmentReport.cpp b/brion/compartmentReport.cpp index b379fac..7b9cb26 100644 --- a/brion/compartmentReport.cpp +++ b/brion/compartmentReport.cpp @@ -56,26 +56,6 @@ CompartmentReport::CompartmentReport( const URI& uri, const int mode, { } -CompartmentReport::CompartmentReport( const std::string& source, - const GIDSet& gids ) - : _impl( new detail::CompartmentReport( CompartmentReportInitData( - URI( source ), - MODE_READ, - gids ))) -{ -} - -CompartmentReport::CompartmentReport( const std::string& source, - const CompartmentReportFormat, - const bool overwrite ) - : _impl( new detail::CompartmentReport( CompartmentReportInitData( - URI( source ), - overwrite ? MODE_OVERWRITE : - MODE_WRITE, - GIDSet( )))) -{ -} - CompartmentReport::~CompartmentReport() { delete _impl; diff --git a/brion/compartmentReport.h b/brion/compartmentReport.h index 9b97ec2..40076a6 100644 --- a/brion/compartmentReport.h +++ b/brion/compartmentReport.h @@ -53,24 +53,11 @@ class CompartmentReport : public boost::noncopyable * valid * @version 1.4 */ - BRION_API CompartmentReport( const URI& uri, const int mode, + BRION_API CompartmentReport( const URI& uri, int mode, const GIDSet& gids = GIDSet( )); /** @name Read API */ //@{ - /** Open given source to a compartment report for reading. - * - * An empty GIDSet loads all data from the report. - * - * @param source filepath to compartment report - * @param gids the neurons of interest - * @throw std::runtime_error if source is not a valid compartment report - * @version 1.0 - * @deprecated - */ - BRION_API explicit CompartmentReport( const std::string& source, - const GIDSet& gids = GIDSet( )); - /** Update compartment mapping wrt the given GIDs. * * Allows to change the GIDs in an open report without throwing away the @@ -168,20 +155,6 @@ class CompartmentReport : public boost::noncopyable /** @name Write API */ //@{ - /** Open given source to a compartment report for writing. - * - * @param source filepath to compartment report - * @param format output format of the report - * @param overwrite true to allow overwrite of existing file - * @throw std::runtime_error if source is not a valid compartment report or - * if location cannot be overwritten - * @version 1.0 - * @deprecated - */ - BRION_API CompartmentReport( const std::string& source, - const CompartmentReportFormat format, - const bool overwrite = false ); - /** Write the header information of this report. * * @param startTime the start time of the report diff --git a/brion/compartmentReportPlugin.h b/brion/compartmentReportPlugin.h index 88b95d2..52a59c7 100644 --- a/brion/compartmentReportPlugin.h +++ b/brion/compartmentReportPlugin.h @@ -24,6 +24,8 @@ #include #include +#include + namespace brion { diff --git a/brion/enums.h b/brion/enums.h index d509e63..1f9c6f7 100644 --- a/brion/enums.h +++ b/brion/enums.h @@ -22,9 +22,7 @@ #ifndef BRION_ENUMS #define BRION_ENUMS -#include -#include -#include +#include namespace brion { @@ -44,22 +42,6 @@ enum BlueConfigSection CONFIGSECTION_ALL //!< @internal must be last }; -/** - * The supported formats for compartment reports. - * @deprecated since version 1.4, kept until removed from BBPSDK and replaced by - * a string. - */ -enum CompartmentReportFormat -{ - REPORTFORMAT_BINARY, - REPORTFORMAT_HDF5, - REPORTFORMAT_STREAM, - REPORTFORMAT_LEVELDB, //!< @version 1.4 - REPORTFORMAT_SKV, //!< @version 1.4 - REPORTFORMAT_NULL, //!< @version 1.4 - REPORTFORMAT_INVALID -}; - /** The supported structural mesh types. */ enum MeshStructure { @@ -272,54 +254,4 @@ enum AccessMode } } -namespace boost -{ - -// CompartmentReportFormat <-> std::string converters (used for type -// field in BlueConfig) - -/** @internal */ -template<> inline -std::string lexical_cast( const brion::enums::CompartmentReportFormat& f ) -{ - switch( f ) - { - case brion::enums::REPORTFORMAT_BINARY: return "bin"; - case brion::enums::REPORTFORMAT_HDF5: return "hdf5"; - case brion::enums::REPORTFORMAT_STREAM: return "stream"; - case brion::enums::REPORTFORMAT_LEVELDB: return "leveldb"; - case brion::enums::REPORTFORMAT_SKV: return "skv"; - case brion::enums::REPORTFORMAT_NULL: return "null"; - case brion::enums::REPORTFORMAT_INVALID: return "invalid"; - default: return lexical_cast< std::string >( int( f )); - } -} - -/** @internal */ -template<> inline -brion::enums::CompartmentReportFormat lexical_cast( const std::string& string ) -{ - std::string type = string; - algorithm::to_lower( type ); - - if( type == "binary" || type == "bin" ) - return brion::enums::REPORTFORMAT_BINARY; - if( type.empty() || boost::filesystem::is_directory( type ) || - type == "hdf5" ) - { - return brion::enums::REPORTFORMAT_HDF5; - } - if( type == "stream" ) - return brion::enums::REPORTFORMAT_STREAM; - if( type == "leveldb" ) - return brion::enums::REPORTFORMAT_LEVELDB; - if( type == "skv" ) - return brion::enums::REPORTFORMAT_SKV; - if( type == "null" ) - return brion::enums::REPORTFORMAT_NULL; - return brion::enums::REPORTFORMAT_INVALID; -} -} - - #endif diff --git a/brion/plugin/compartmentReportBinary.cpp b/brion/plugin/compartmentReportBinary.cpp index d65f17b..c2e16ad 100644 --- a/brion/plugin/compartmentReportBinary.cpp +++ b/brion/plugin/compartmentReportBinary.cpp @@ -19,6 +19,7 @@ #include "compartmentReportBinary.h" +#include #include #include #include diff --git a/brion/plugin/spikeReportBinary.cpp b/brion/plugin/spikeReportBinary.cpp index c2350c4..eae00a4 100644 --- a/brion/plugin/spikeReportBinary.cpp +++ b/brion/plugin/spikeReportBinary.cpp @@ -22,6 +22,8 @@ #include #include +#include + #define BINARY_REPORT_FILE_EXT ".spikes" namespace brion diff --git a/brion/plugin/spikeReportFile.h b/brion/plugin/spikeReportFile.h index bc4610d..096c580 100644 --- a/brion/plugin/spikeReportFile.h +++ b/brion/plugin/spikeReportFile.h @@ -23,6 +23,7 @@ #include #include "spikeReportTypes.h" +#include #include namespace brion diff --git a/brion/plugin/spikeReportSimpleStreamer.cpp b/brion/plugin/spikeReportSimpleStreamer.cpp index a22af20..d3cd60e 100644 --- a/brion/plugin/spikeReportSimpleStreamer.cpp +++ b/brion/plugin/spikeReportSimpleStreamer.cpp @@ -21,6 +21,8 @@ #include "spikeReportFile.h" #include "../pluginInitData.h" +#include + namespace brion { namespace plugin diff --git a/doc/Changelog.md b/doc/Changelog.md index f25d34c..2630764 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -3,12 +3,21 @@ Changelog {#Changelog} # git master +* [74](https://github.com/BlueBrain/Brion/pull/74): + Remove deprecated enums and functions: + - `CompartmentReport( const std::string&, const GIDSet& )` and + `CompartmentReport( const std::string&, + const brion::CompartmentReportFormat, const bool )` constructors; use + brion::CompartmentReport::CompartmentReport( const brion::URI&, int, const brion::GIDSet& ) + instead + - `enum CompartmentReportFormat`; use brion::BlueConfig::getReportSource() + instead * [71](https://github.com/BlueBrain/Brion/pull/71): Transparent caching of Synapse loading. See [Lunchbox#263](https://github.com/Eyescale/Lunchbox/pull/263) for configuration. * [69](https://github.com/BlueBrain/Brion/pull/69): - Speedup brain::Circuit::getIDs(), add brion::BlueConfig::getTargetSources() + Speedup brain::Circuit::getGIDs(), add brion::BlueConfig::getTargetSources() * [63](https://github.com/BlueBrain/Brion/pull/63): Moved old BBPSDK/Monsteer spike report to Brain (pending refactoring) diff --git a/tests/compartmentReport.cpp b/tests/compartmentReport.cpp index f77702d..bf5eedf 100644 --- a/tests/compartmentReport.cpp +++ b/tests/compartmentReport.cpp @@ -33,6 +33,7 @@ #define BOOST_TEST_MODULE CompartmentReport #include +#include #include #include #include @@ -69,7 +70,6 @@ BOOST_AUTO_TEST_CASE( test_open_binary ) { boost::filesystem::path path( BBP_TESTDATA ); path /= "local/simulations/may17_2011/Control/voltage.bbp"; - BOOST_CHECK_NO_THROW( brion::CompartmentReport( path.string( ))); BOOST_CHECK_NO_THROW( brion::CompartmentReport( brion::URI( path.string( )), brion::MODE_READ )); } @@ -78,7 +78,6 @@ BOOST_AUTO_TEST_CASE( test_open_hdf5 ) { boost::filesystem::path path( BBP_TESTDATA ); path /= "local/simulations/may17_2011/Control/voltage.h5"; - BOOST_CHECK_NO_THROW( brion::CompartmentReport( path.string( ))); BOOST_CHECK_NO_THROW( brion::CompartmentReport( brion::URI( path.string( )), brion::MODE_READ )); } diff --git a/tests/spikeReport.cpp b/tests/spikeReport.cpp index 7dea14f..7769f0b 100644 --- a/tests/spikeReport.cpp +++ b/tests/spikeReport.cpp @@ -33,6 +33,7 @@ #include #define BOOST_TEST_MODULE SpikeReport +#include #include #include