Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major refactoring (breaking changes!) #30

Merged
merged 86 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
c024f14
Introduce exceptions internal to module(s).
tanaya-mankad Jan 16, 2023
d2ead71
Rewrite error and message handling for GridAxis.
tanaya-mankad Jan 20, 2023
b35833b
Fix tests.
tanaya-mankad Jan 23, 2023
b77c721
Disable fast fail on CI.
tanaya-mankad Jan 23, 2023
75e0dff
Add functional header.
tanaya-mankad Jan 23, 2023
b7567b6
Update gh actions checkout.
tanaya-mankad Jan 23, 2023
b17812f
Try CI with Ubuntu 20.
tanaya-mankad Jan 23, 2023
206e3e4
Try CI with Ubuntu 22.
tanaya-mankad Jan 23, 2023
8b2b8ba
Try CI with only working OS values.
tanaya-mankad Jan 23, 2023
1580727
Start moving toward saner cmake defaults.
tanaya-mankad Jan 23, 2023
53e58b3
Update CI matrix.
tanaya-mankad Jan 23, 2023
0d095ef
Apply clang-format file.
tanaya-mankad Jan 23, 2023
d23cf39
Revert return values to simple ones.
tanaya-mankad Jan 25, 2023
c9963ed
Remove default constructors and adjust tests. Pass callback by pointe…
tanaya-mankad Feb 6, 2023
182dcf6
Remove vestigial error strings returned by funcs.
tanaya-mankad Feb 6, 2023
16e2c35
Pass ptr to const function.
tanaya-mankad Feb 6, 2023
6d46ec3
Improve const-correctness; remove redundancy in tests.
tanaya-mankad Feb 8, 2023
89b4f05
Disambiguate constructors.
tanaya-mankad Feb 8, 2023
a6d346b
Construct test_gridded_data directly.
tanaya-mankad Feb 8, 2023
1691b7f
Put back default constructors; alternative is exactly the same thing.
tanaya-mankad Feb 13, 2023
5ff6281
Variable cleanup.
tanaya-mankad Feb 13, 2023
21cc1e6
Remove global callback entirely.
tanaya-mankad Feb 14, 2023
788bb26
Separate setting the callback and the context.
tanaya-mankad Feb 20, 2023
f59fc90
Pass string_view by value.
tanaya-mankad Feb 21, 2023
d16a384
Merge crom unnecessary branch.
tanaya-mankad Feb 21, 2023
3d290aa
Integrate Courierr logging.
tanaya-mankad Mar 7, 2023
651bb75
Make Courierr dependency non-optional; fix constructors and tests acc…
tanaya-mankad Mar 13, 2023
70cad02
Update Courierr.
tanaya-mankad Mar 14, 2023
fbfa886
Add getter for Courierr instance.
tanaya-mankad Mar 14, 2023
42857cb
Allow GridAxis to contain a different logger than owning RGI.
tanaya-mankad Mar 20, 2023
ca51659
Modify EXPECT_STDOUT for throwing functions (gcc).
tanaya-mankad Mar 20, 2023
fccf886
Initial refactoring.
nealkruis Mar 22, 2023
60a15d8
Include algorithm header.
nealkruis Mar 22, 2023
e9d25f5
Reorganize unit tests.
nealkruis Mar 23, 2023
f2c18ff
Clean up function fixtures.
nealkruis Mar 23, 2023
9bab8ed
Move 4D function fixture.
nealkruis Mar 23, 2023
7ed6456
Renaming to match style convensions.
nealkruis Mar 23, 2023
a364188
Allow default loggers.
nealkruis Mar 23, 2023
d67cab3
Further refactoring.
nealkruis Mar 24, 2023
1cb3ae0
Change spacing multipliers functions.
nealkruis Mar 24, 2023
5a12bd1
Rename spacing multipliers.
nealkruis Mar 24, 2023
df77b22
Rename grid point related methods/variables.
nealkruis Mar 25, 2023
9181065
More renaming.
nealkruis Mar 25, 2023
b625bbf
Rename dimension -> axis.
nealkruis Mar 25, 2023
b3a1d5f
Rename flavor to floor_or_ceiling.
nealkruis Mar 25, 2023
8e00c7a
Clean up CMake courierr variables.
nealkruis Mar 25, 2023
af79639
Address static analysis issues.
nealkruis Mar 25, 2023
e8ab203
Update clang format.
nealkruis Mar 25, 2023
ac8857c
Rework bound detection.
nealkruis Mar 26, 2023
f03e445
Attempt to improve testing coverage.
nealkruis Mar 26, 2023
4762e7d
Add ability to get target bounds status.
nealkruis Mar 26, 2023
5c1456f
Clean up constructors.
nealkruis Mar 26, 2023
17939b6
Rename value tabels to grid point data set.
nealkruis Mar 27, 2023
39408c6
Add get_grid_axis function.
nealkruis Mar 27, 2023
8e3a971
Add grid axis and grid point data set names. Use names in log messages.
nealkruis Mar 28, 2023
1a8c666
Revise logger message format.
nealkruis Mar 28, 2023
37b2841
Fix write_data test.
nealkruis Mar 28, 2023
7d193a7
Make extrapolation limit violation throw an exception.
nealkruis Mar 28, 2023
0ef9aab
Re-organize GridAxis constructor. Other clean up.
nealkruis Mar 28, 2023
becfd95
Update README.
nealkruis Mar 28, 2023
110c174
Clean up write_data method.
nealkruis Mar 28, 2023
f57bf64
Update Actions workflow.
nealkruis Mar 28, 2023
296b7d2
Fix runs-on in Actions workflow.
nealkruis Mar 28, 2023
b752591
Fix coverage variable step.
nealkruis Mar 28, 2023
472f5a5
Rename 'Private' to 'Implementation'.
nealkruis Mar 29, 2023
92a29c3
Clean up test headers.
nealkruis Mar 29, 2023
c49956a
Clean up naming consistency.
nealkruis Mar 30, 2023
162bfe9
Clean up index naming.
nealkruis Mar 30, 2023
8716f6c
Make all implementation members private.
nealkruis Mar 30, 2023
284f408
Rename implementation header file.
nealkruis Mar 30, 2023
a332bc7
Rename implementation member variable.
nealkruis Mar 30, 2023
bc68d20
Add interface target for public headers.
nealkruis Mar 30, 2023
202a68b
Increase test coverage. Additional cleanup.
nealkruis Mar 30, 2023
c399fa0
Change logger class name.
nealkruis Mar 30, 2023
b544430
Logging context clean up.
nealkruis Mar 31, 2023
404a2d4
Add missing namespace designator.
tanaya-mankad Apr 4, 2023
92ee603
Add functions as needed by EnergyPlus integration.
tanaya-mankad Apr 7, 2023
26eae06
Fix normalization at target after adding a new grid point data set wi…
nealkruis Apr 21, 2023
7e27729
Move all construction definitions into implementation for use with fo…
tanaya-mankad Apr 26, 2023
fd21da4
Merge branch 'separate-public-header' of https://github.com/bigladder…
tanaya-mankad Apr 26, 2023
657b3f9
Remove default constructors.
tanaya-mankad Apr 26, 2023
a4e3f98
Revert to including default constructors.
tanaya-mankad Apr 28, 2023
f97745a
Try include guards instead of pragma.
tanaya-mankad May 3, 2023
99e3e8a
Try include guards to prevent multiple submodules redefining classes.
tanaya-mankad May 3, 2023
992f431
Try include guards to prevent multiple submodules redefining classes.
tanaya-mankad May 3, 2023
eaeab04
Remove commented line.
tanaya-mankad May 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 64 additions & 50 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,111 +1,125 @@
# Supports clang-format 10
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: None
AlignEscapedNewlines: Right
AlignOperands: true
#CF12# AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true # depr. after CF14, see PackConstructorInitializers
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
#CF12# AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
AlwaysBreakTemplateDeclarations: Yes
#CF12# AttributeMacros: []
BinPackArguments: false
BinPackParameters: false
#CF12# BitFieldColonSpacing:
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeBraces: Stroustrup
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: AfterComma
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CommentPragmas: ''
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
#CF11# DeriveLindEnding: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
ForEachMacros: []
IncludeBlocks: Preserve
IncludeCategories:
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainRegex: '(test)?$'
IncludeIsMainSourceRegex: ''
#CF13# IndentAccessModifiers:
#CF11# IndentCaseBlocks:
IndentCaseLabels: false
#CF12# IndentExternBlock
IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 2
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
#CF12# InsertTrailingCommas:
KeepEmptyLinesAtTheStartOfBlocks: true
#CF13# LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
NamespaceMacros: []
#CF14# PPIndentWidth:
#CF14# PackConstructorInitializers: Never
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
#CF12# PenaltyIndentedWhitespace:
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
PointerAlignment: Left
#CF14# QualifierAlignment
#CF14# QualifierOrder
RawStringFormats: []
#CF14# ReferenceAlignment: Right
ReflowComments: true
SortIncludes: true
#CF14# ShortNamespaceLines:
SortIncludes: Never
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
#CF12# SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
#CF14# SpaceBeforeParensOptions:
# AfterControlStatements: true
# AfterFunctionDefinitionName: true
SpaceBeforeRangeBasedForLoopColon: true
#CF11# SpaceBeforeSquareBrackets: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
#CF14# SpacesInAngles: false
SpacesInCStyleCastParentheses: false
#CF11# SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
#CF14# SpacesInLineCommentPrefix:
# Minimum: 0
# Maximum: 1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
#CF12# StatementAttributeLikeMacros:
StatementMacros: []
TabWidth: 4
#CF11# UseCRLF: Never
UseTab: Never
...

#CF12# WhitespaceSensitiveMacros []
82 changes: 59 additions & 23 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,88 @@ on: push

jobs:
build-and-test:
name: Build
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu
os_ver: "22.04"
config: Release
static_lib: ON
coverage: OFF
- os: windows-latest
coverage: false
cc: gcc-11
cxx: g++-11
- os: ubuntu
os_ver: "20.04"
config: Release
static_lib: ON
coverage: OFF
- os: macos-latest
coverage: false
cc: gcc-10
cxx: g++-10
- os: windows
os_ver: "2022"
config: Release
static_lib: ON
coverage: OFF
- os: ubuntu-latest
config: Debug
static_lib: OFF
coverage: ON
- os: ubuntu-18.04
coverage: false
cc: cl
cxx: cl
- os: macos
os_ver: "12"
config: Release
coverage: false
cc: clang
cxx: clang++
- os: macos
os_ver: "11"
config: Release
static_lib: ON
coverage: OFF
coverage: false
cc: clang
cxx: clang++
- os: ubuntu
os_ver: "20.04"
config: Debug
coverage: true
cc: gcc-10
cxx: g++-10
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}-${{ matrix.os_ver }} ${{ matrix.cxx }} ${{ matrix.config }} coverage=${{ matrix.coverage }}
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
runs-on: ${{ matrix.os }}-${{ matrix.os_ver }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set Project Name
run: echo "REPOSITORY_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
- name: Create Build Directory
run: cmake -E make_directory ${{github.workspace}}/build
- name: Set coverage variables
id: cov
run: |
if ${{matrix.coverage}}; then
echo "COVERAGE=ON" >> $GITHUB_OUTPUT
echo "STATIC_LIB=OFF" >> $GITHUB_OUTPUT
else
echo "COVERAGE=OFF" >> $GITHUB_OUTPUT
echo "STATIC_LIB=ON" >> $GITHUB_OUTPUT
fi
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="${{ matrix.config }}" -D${{ env.REPOSITORY_NAME }}_BUILD_TESTING="ON" -D${{ env.REPOSITORY_NAME }}_STATIC_LIB="${{ matrix.static_lib }}" -D${{ env.REPOSITORY_NAME }}_COVERAGE="${{ matrix.coverage }}"
run: cmake -S . -B build -DCMAKE_BUILD_TYPE="${{ matrix.config }}" -D${{ env.REPOSITORY_NAME }}_BUILD_TESTING="ON" -D${{ env.REPOSITORY_NAME }}_STATIC_LIB="${{ steps.cov.outputs.STATIC_LIB }}" -D${{ env.REPOSITORY_NAME }}_COVERAGE="${{ steps.cov.outputs.COVERAGE }}"
- name: Build
run: cmake --build build --config ${{ matrix.config }}
- name: Test
run: ctest -C ${{ matrix.config }} --output-on-failure
working-directory: build
- name: Code Coverage Analysis
if: matrix.coverage == 'ON'
if: "matrix.coverage"
run: make gcov
working-directory: build
- name: Upload Code Coverage Report
if: matrix.coverage == 'ON'
uses: codecov/codecov-action@v2
if: "matrix.coverage"
uses: codecov/codecov-action@v3
with:
flags: integration
functionalities: "gcov"
move_coverage_to_trash: true
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ignore the build directory
builds
build
.idea
.vs/
builds/
build/
.idea/
.vs/
.vscode/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[submodule "vendor/googletest"]
path = vendor/googletest
url = https://github.com/google/googletest.git
[submodule "vendor/courierr"]
path = vendor/courierr
url = https://github.com/bigladder/courierr.git
[submodule "vendor/fmt"]
path = vendor/fmt
url = https://github.com/fmtlib/fmt.git
46 changes: 23 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@ cmake_minimum_required(VERSION 3.10)
project(btwxt)

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif ()

find_package(Git QUIET)

set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

include(compiler-flags)

option( ${PROJECT_NAME}_BUILD_TESTING "Build ${PROJECT_NAME} testing targets" OFF )
option( ${PROJECT_NAME}_COVERAGE "Add ${PROJECT_NAME} coverage reports" OFF)
option(${PROJECT_NAME}_BUILD_TESTING "Build ${PROJECT_NAME} testing targets" OFF)
option(${PROJECT_NAME}_COVERAGE "Add ${PROJECT_NAME} coverage reports" OFF)

# Set up testing/coverage
if (${PROJECT_NAME}_BUILD_TESTING)
enable_testing()
if (${PROJECT_NAME}_COVERAGE)
set(ENABLE_COVERAGE ON CACHE BOOL "" FORCE)
find_package(codecov)
endif()
endif()


enable_testing()
if (${PROJECT_NAME}_COVERAGE)
set(ENABLE_COVERAGE ON CACHE BOOL "" FORCE)
find_package(codecov)
endif ()
endif ()

add_subdirectory("include/${PROJECT_NAME}")
add_subdirectory(src)
add_subdirectory(vendor)

if (${PROJECT_NAME}_BUILD_TESTING)
add_subdirectory(test)
if (${PROJECT_NAME}_COVERAGE)
coverage_evaluate()
endif()
endif()
add_subdirectory(test)
if (${PROJECT_NAME}_COVERAGE)
coverage_evaluate()
endif ()
endif ()
Loading