Skip to content

Commit 03cd55a

Browse files
authored
Merge pull request #654 from ax3l/doc-doxygenWarnings
Doxygen: Fix Many Warnings
2 parents b58a3a5 + a808055 commit 03cd55a

17 files changed

+140
-26
lines changed

.github/workflows/source.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ on: [push, pull_request]
44

55
jobs:
66
style:
7-
87
runs-on: ubuntu-latest
9-
108
steps:
119
- uses: actions/checkout@v1
1210
- name: TABs
1311
run: .github/workflows/source/hasTabs
1412
- name: End-of-Line whitespaces
1513
run: .github/workflows/source/hasEOLwhiteSpace
14+
15+
documentation:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Install
20+
run: sudo apt-get install -y --no-install-recommends doxygen
21+
- name: Doxygen
22+
run: .github/workflows/source/buildDoxygen

.github/workflows/source/buildDoxygen

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2020 Axel Huebl
4+
#
5+
# License: LGPLv3+
6+
7+
# search recursive inside a folder if a file contains tabs
8+
#
9+
# @result 0 if no files are found, else 1
10+
#
11+
12+
set -eu -o pipefail
13+
14+
cd docs
15+
echo "WARN_AS_ERROR = YES" >> Doxyfile
16+
doxygen

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ if(openPMD_HAVE_PYTHON)
532532
src/binding/python/RecordComponent.cpp
533533
src/binding/python/MeshRecordComponent.cpp
534534
src/binding/python/Series.cpp
535+
src/binding/python/UnitDimension.cpp
535536
)
536537
target_link_libraries(openPMD.py PRIVATE openPMD)
537538

docs/Doxyfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
PROJECT_NAME = "openPMD-api"
22
XML_OUTPUT = xml
3-
INPUT = ../
4-
EXCLUDE_PATTERNS = */share/openPMD/thirdParty/*
3+
INPUT = ../src ../include
4+
EXCLUDE_PATTERNS = *CommonADIOS1IOHandler.cpp *benchmark*
5+
6+
# TAGFILES += "cppreference-doxygen-web.tag.xml=http://en.cppreference.com/w/"
7+
BUILTIN_STL_SUPPORT = YES
8+
59
GENERATE_LATEX = NO
610
GENERATE_MAN = NO
711
GENERATE_RTF = NO
@@ -14,13 +18,17 @@ JAVADOC_AUTOBRIEF = YES
1418
USE_MDFILE_AS_MAINPAGE = README.md
1519

1620
# "enable" all frontends and backends
17-
PREDEFINED = openPMD_HAVE_MPI=1 \
21+
MACRO_EXPANSION = YES
22+
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \
23+
openPMD_HAVE_MPI=1 \
1824
openPMD_HAVE_HDF5=1 \
1925
openPMD_HAVE_ADIOS1=1 \
2026
openPMD_HAVE_ADIOS2=1 \
2127
openPMD_HAVE_PYTHON=1 \
2228
OPENPMD_private:=private \
23-
OPENPMD_protected:=protected
29+
OPENPMD_protected:=protected \
30+
__attribute__(x)= \
31+
__declspec(x)=
2432

2533
# ideally, you want to warn on missing doc coverage!
2634
WARN_IF_UNDOCUMENTED = NO

include/openPMD/IO/ADIOS/ADIOS2IOHandler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ class ADIOS2IOHandlerImpl
223223

224224
/**
225225
* @brief nameOfAttribute
226-
* @param The Writable at whose level the attribute lies.
227-
* @param The openPMD name of the attribute.
226+
* @param writable The Writable at whose level the attribute lies.
227+
* @param attribute The openPMD name of the attribute.
228228
* @return The ADIOS2 name of the attribute, consisting of
229229
* the variable that the attribute is associated with
230230
* (possibly the empty string, representing no variable)

include/openPMD/IO/AbstractIOHandlerImplCommon.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class AbstractIOHandlerImplCommon : public AbstractIOHandlerImpl
9797
/**
9898
* Figure out the file position of the writable and extend it.
9999
* @param writable The writable.
100-
* @param write The extension string.
100+
* @param extend The extension string.
101101
* @return The current file position.
102102
*/
103103
virtual std::shared_ptr< FilePositionType >

include/openPMD/UnitDimension.hpp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* Copyright 2020 Axel Huebl
2+
*
3+
* This file is part of openPMD-api.
4+
*
5+
* openPMD-api is free software: you can redistribute it and/or modify
6+
* it under the terms of of either the GNU General Public License or
7+
* the GNU Lesser General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* openPMD-api is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License and the GNU Lesser General Public License
15+
* for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* and the GNU Lesser General Public License along with openPMD-api.
19+
* If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
#pragma once
22+
23+
#include <cstdint>
24+
25+
26+
namespace openPMD
27+
{
28+
/** Physical dimension of a record
29+
*
30+
* Dimensional base quantities of the international system of quantities
31+
*/
32+
enum class UnitDimension : uint8_t
33+
{
34+
L = 0, //!< length
35+
M, //!< mass
36+
T, //!< time
37+
I, //!< electric current
38+
theta, //!< thermodynamic temperature
39+
N, //!< amount of substance
40+
J //!< luminous intensity
41+
};
42+
} // namespace openPMD

include/openPMD/backend/BaseRecord.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "openPMD/backend/Container.hpp"
2424
#include "openPMD/RecordComponent.hpp"
25+
#include "openPMD/UnitDimension.hpp"
2526

2627
#include <array>
2728
#include <string>
@@ -30,10 +31,6 @@
3031

3132
namespace openPMD
3233
{
33-
enum class UnitDimension : uint8_t
34-
{
35-
L = 0, M, T, I, theta, N, J
36-
};
3734

3835
template< typename T_elem >
3936
class BaseRecord : public Container< T_elem >

include/openPMD/backend/BaseRecordComponent.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class BaseRecordComponent : public Attributable
6464
namespace detail
6565
{
6666
/**
67-
* Functor template to be used in combination with <switchType>"()"
67+
* Functor template to be used in combination with switchType::operator()
6868
* to set a default value for constant record components via the
6969
* respective type's default constructor.
7070
* Used to implement empty datasets in subclasses of BaseRecordComponent

include/openPMD/backend/Container.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace traits
4141
/** Container Element Creation Policy
4242
*
4343
* The operator() of this policy is called after the container
44-
* ::insert of a new element. The passed parameter is an iterator to the
44+
* insert() of a new element. The passed parameter is an iterator to the
4545
* newly added element.
4646
*/
4747
template< typename U >

include/openPMD/openPMD.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*/
2121
#pragma once
2222

23+
/** Public definitions of openPMD-api
24+
*/
25+
namespace openPMD {}
26+
2327
// IWYU pragma: begin_exports
2428
#include "openPMD/Dataset.hpp"
2529
#include "openPMD/Datatype.hpp"
@@ -31,6 +35,7 @@
3135
#include "openPMD/RecordComponent.hpp"
3236
#include "openPMD/Record.hpp"
3337
#include "openPMD/Series.hpp"
38+
#include "openPMD/UnitDimension.hpp"
3439

3540
#include "openPMD/backend/Attributable.hpp"
3641
#include "openPMD/backend/Attribute.hpp"

src/IO/ADIOS/ADIOS1IOHandler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,11 @@ ADIOS1IOHandlerImpl::initialize_group(std::string const &name)
306306
return group;
307307
}
308308

309+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
309310
#define CommonADIOS1IOHandlerImpl ADIOS1IOHandlerImpl
310311
#include "CommonADIOS1IOHandler.cpp"
311312
#undef CommonADIOS1IOHandlerImpl
313+
#endif
312314

313315
#else
314316
ADIOS1IOHandler::ADIOS1IOHandler(std::string path, AccessType at)

src/IO/ADIOS/ParallelADIOS1IOHandler.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,11 @@ ParallelADIOS1IOHandlerImpl::initialize_group(std::string const &name)
319319
return group;
320320
}
321321

322+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
322323
#define CommonADIOS1IOHandlerImpl ParallelADIOS1IOHandlerImpl
323324
#include "CommonADIOS1IOHandler.cpp"
324325
#undef CommonADIOS1IOHandlerImpl
326+
#endif
325327

326328
#else
327329
# if openPMD_HAVE_MPI

src/Record.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* If not, see <http://www.gnu.org/licenses/>.
2020
*/
2121
#include "openPMD/Record.hpp"
22+
#include "openPMD/RecordComponent.hpp"
23+
#include "openPMD/backend/BaseRecord.hpp"
2224

2325
#include <iostream>
2426

@@ -131,7 +133,7 @@ Record::read()
131133
readAttributes();
132134
}
133135

134-
template
136+
template <>
135137
BaseRecord<RecordComponent>::mapped_type&
136138
BaseRecord<RecordComponent>::operator[](std::string&& key);
137139
} // openPMD

src/binding/python/BaseRecord.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,4 @@ void init_BaseRecord(py::module &m) {
4242
.def_property_readonly("unit_dimension", &BaseRecord< BaseRecordComponent >::unitDimension);
4343
py::class_<BaseRecord< PatchRecordComponent >, Container< PatchRecordComponent > >(m, "Base_Record_Patch_Record_Component")
4444
.def_property_readonly("unit_dimension", &BaseRecord< PatchRecordComponent >::unitDimension);
45-
46-
py::enum_<UnitDimension>(m, "Unit_Dimension")
47-
.value("L", UnitDimension::L)
48-
.value("M", UnitDimension::M)
49-
.value("T", UnitDimension::T)
50-
.value("I", UnitDimension::I)
51-
.value("theta", UnitDimension::theta)
52-
.value("N", UnitDimension::N)
53-
.value("J", UnitDimension::J)
54-
;
5545
}

src/binding/python/UnitDimension.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* Copyright 2018-2020 Axel Huebl
2+
*
3+
* This file is part of openPMD-api.
4+
*
5+
* openPMD-api is free software: you can redistribute it and/or modify
6+
* it under the terms of of either the GNU General Public License or
7+
* the GNU Lesser General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* openPMD-api is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License and the GNU Lesser General Public License
15+
* for more details.
16+
*
17+
* You should have received a copy of the GNU General Public License
18+
* and the GNU Lesser General Public License along with openPMD-api.
19+
* If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
#include <pybind11/pybind11.h>
22+
#include <pybind11/stl.h>
23+
24+
#include "openPMD/UnitDimension.hpp"
25+
26+
namespace py = pybind11;
27+
using namespace openPMD;
28+
29+
30+
void init_UnitDimension(py::module &m) {
31+
py::enum_<UnitDimension>(m, "Unit_Dimension")
32+
.value("L", UnitDimension::L)
33+
.value("M", UnitDimension::M)
34+
.value("T", UnitDimension::T)
35+
.value("I", UnitDimension::I)
36+
.value("theta", UnitDimension::theta)
37+
.value("N", UnitDimension::N)
38+
.value("J", UnitDimension::J)
39+
;
40+
}

src/binding/python/openPMD.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ void init_PatchRecordComponent(py::module &);
5050
void init_Record(py::module &);
5151
void init_RecordComponent(py::module &);
5252
void init_Series(py::module &);
53+
void init_UnitDimension(py::module &);
5354

5455

5556
PYBIND11_MODULE(openpmd_api, m) {
5657
// m.doc() = ...;
5758

5859
// note: order from parent to child classes
5960
init_AccessType(m);
61+
init_UnitDimension(m);
6062
init_Attributable(m);
6163
init_Container(m);
6264
init_BaseRecord(m);

0 commit comments

Comments
 (0)