Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
54da9f0
Cleanup the general cmake for the project
adam-parker1 Jun 17, 2025
47e287d
Initial draft of test suite
adam-parker1 Jun 17, 2025
c34f1c1
Rework testing CMakeLists.txt and add placeholder main to demonstrate…
adam-parker1 Jun 17, 2025
ff3173b
Simplify test CMakeLists, remove trompoleil and mocking, add create p…
adam-parker1 Jul 4, 2025
47c7cac
Add initial value_mapping tests for 0d, fix interface + datablock all…
adam-parker1 Jul 8, 2025
78529f1
Add tests for ValueMapping with 1d ints and floats; template later
adam-parker1 Jul 8, 2025
6e2302a
Rename test tags in value_mapping_test
adam-parker1 Jul 9, 2025
340e48f
Remove interface from MapArguments and change to datablock, move rank…
adam-parker1 Jul 9, 2025
73cd8fd
Update expr_mapping with float vs double bugfix and move to use datab…
adam-parker1 Jul 9, 2025
4dbab18
updating PluginMapping
jholloc Jul 9, 2025
d16df56
Update test_helpers to create DataBlock rather than full interface, a…
adam-parker1 Jul 9, 2025
4503482
adding PluginMapping tests
jholloc Jul 10, 2025
016e926
init client_block, data_source, and signal_desc structures on the int…
adam-parker1 Jul 11, 2025
76e54e1
tidying up includes
jholloc Jul 11, 2025
d2c450b
adding syntax parser
jholloc Jul 11, 2025
dc73e2f
extracting indices extractor into its own file and replacing std::reg…
jholloc Jul 11, 2025
cd8662a
moving mapping code from plugin into MappingHandler
jholloc Jul 12, 2025
38ce67c
removing dependency on DATA_BLOCK from mappings
jholloc Jul 13, 2025
e5a5a29
renaming plugin to data source mapping and introducing data source in…
jholloc Jul 13, 2025
1641d3c
separting out UDA specific caching from ram cache code
jholloc Jul 14, 2025
0722b8d
adding UDA data source to JSON mapping plugin
jholloc Jul 15, 2025
e86e0a4
moving uda code into separate folder and updating subset
jholloc Jul 16, 2025
2f648cc
rewritting subsetting code to work with TypedDataArray
jholloc Jul 17, 2025
0a857d0
adding additional tests
jholloc Jul 17, 2025
38165fb
splitting out non-UDA code into libtokamap directory
jholloc Jul 17, 2025
71c3d80
adding mapping_plugin files
jholloc Jul 17, 2025
d1d2f6f
adding CI workflow for build and test
jholloc Jul 17, 2025
7eefde6
fixing CI build
jholloc Jul 18, 2025
d66c55a
fixing CI build
jholloc Jul 18, 2025
5829d28
switching on compile warnings
jholloc Jul 18, 2025
2d5d629
fixing ubuntu build issue
jholloc Jul 18, 2025
2905f81
tidying up namespaces
jholloc Jul 18, 2025
9caaccc
adding simple_mapper example to libtokamap
jholloc Jul 20, 2025
07f9db3
replacing recursive functions with iterative versions
jholloc Jul 21, 2025
61ee4ae
removing boost dependency
jholloc Jul 21, 2025
b10c589
replacing reinterpret_cast with bit_cast
jholloc Jul 21, 2025
c0a2277
Removed SignalType logic
jholloc Jul 21, 2025
475d084
Replaced std::string{} with string_literals
jholloc Jul 21, 2025
5fff7d4
Adding tests for parse_slices
jholloc Jul 21, 2025
3bc11d8
adding missing file
jholloc Jul 21, 2025
84d9b62
adding README.md
jholloc Jul 22, 2025
e0173cf
adding release method to TypedDataArray
jholloc Jul 22, 2025
4da1f8a
default TypedDataArray owning to true
jholloc Jul 22, 2025
acda554
adding new exception types
jholloc Jul 22, 2025
2412d86
Fix json_mapping.cfg.in naming and correct typo to UDA_MAPPING_CACHE_…
adam-parker1 Jul 22, 2025
7a2d1eb
Merge branch 'feature/libtokamap' of github.com:ukaea/JSON-mapping-pl…
adam-parker1 Jul 22, 2025
19d3639
Handle void in the type_maps and catch the libtokamap::MappingError e…
adam-parker1 Jul 22, 2025
10eca71
adding validator util
jholloc Jul 22, 2025
3f43ebd
adding json schemas
jholloc Jul 22, 2025
e6babd2
Merge branch 'feature/libtokamap' of github.com:ukaea/JSON-mapping-pl…
jholloc Jul 22, 2025
b62fd8e
changing exception type in MappingHandler
jholloc Jul 22, 2025
ea8b85d
validating mappings on load
jholloc Jul 23, 2025
a499410
Update hardcoded dd_version to 3.42.0, increase array print size to 1…
adam-parker1 Jul 23, 2025
facbb0d
Merge branch 'feature/libtokamap' of github.com:ukaea/JSON-mapping-pl…
adam-parker1 Jul 23, 2025
a016dcf
Replace delete[] with free(...) in TypedDataArray destructors
adam-parker1 Jul 23, 2025
d45c4d6
Add UDA_TYPE_STRING to data_block type handling in mapping_plugin, + …
adam-parker1 Jul 23, 2025
fc13a7c
Merge branch 'feature/libtokamap' of github.com:ukaea/JSON-mapping-pl…
jholloc Jul 23, 2025
5ce78d0
Expose process_string_node to libtokamap namespace and process the js…
adam-parker1 Jul 23, 2025
66ccfec
Merge branch 'feature/libtokamap' of github.com:ukaea/JSON-mapping-pl…
jholloc Jul 23, 2025
c8480fd
Add tests for process_string_node, skipping those that need fixing
adam-parker1 Jul 23, 2025
00237bf
Merge branch 'feature/libtokamap' of github.com:ukaea/JSON-mapping-pl…
jholloc Jul 23, 2025
464656f
fixing syntax parser tests
jholloc Jul 23, 2025
2b65b15
fixing simple_mapper build issue
jholloc Jul 23, 2025
9a38ff6
rewritting mapping handler to make mapping directory structure more g…
jholloc Jul 27, 2025
32e4d39
fixing handler to read from directory not matching experiment name
jholloc Jul 29, 2025
69050d8
removing libtokamap and using FetchContent to download from github
jholloc Aug 17, 2025
4d36162
updating uda cache
jholloc Aug 20, 2025
051d0a0
removing unneeded functions from caching
jholloc Aug 20, 2025
cdb918c
fixing init function
jholloc Aug 20, 2025
3d588d1
Add new config file handling, added GEOMETRY, CUSTOM_MASTU data sourc…
adam-parker1 Aug 22, 2025
44906e0
Turn off cacheing until it has been reviewed
adam-parker1 Aug 25, 2025
0f00523
Check for ram_cache ptr validity before m_ram_cache operations
adam-parker1 Aug 25, 2025
724c372
Account for time fields in the uda_data_source, check for time bool f…
adam-parker1 Sep 16, 2025
0ba3ad5
removing caching and adding feature to return time instead of data fr…
stephen-dixon Sep 16, 2025
3c9c16b
fixing set-return-time
stephen-dixon Sep 17, 2025
de2bd87
changing set-return semantics in uda_data_source.cpp
stephen-dixon Sep 18, 2025
f735cf4
build fixes
stephen-dixon Sep 19, 2025
317b943
fixing data array bug in uda_data_source
stephen-dixon Sep 19, 2025
3f0531b
adding in more uda types
stephen-dixon Sep 19, 2025
638ff85
adding more uda return types to uda_data_source
stephen-dixon Sep 19, 2025
7c5ca93
Merge branch 'feature/ext-libtokamap' into feature/caching-and-time
adam-parker1 Sep 19, 2025
801d035
*fix* uda_data_source_test.cpp to get it to compile and run
adam-parker1 Sep 19, 2025
5357429
Change headers in utils plugin_helpers to use <libtokamap.hpp>
adam-parker1 Sep 19, 2025
373d19c
tidying up code
jholloc Sep 22, 2025
4b14f9f
updating cmake and commenting out broken CI for now
jholloc Sep 22, 2025
b889bd4
adding option to use libtokamap profiling
jholloc Sep 23, 2025
a734654
making fetching of libtokamap optional (default off)
jholloc Sep 29, 2025
a99ba6b
fixing build when using external libtokamap
jholloc Sep 29, 2025
d1a0e28
fixing activate script
jholloc Oct 1, 2025
060270c
Merge pull request #11 from ukaea/feature/caching-and-time
adam-parker1 Oct 7, 2025
bbb00c5
changing libtokamap package name
jholloc Nov 24, 2025
37a1aa2
Fix for mappings not ending early if not found (instead of returning …
adam-parker1 Dec 2, 2025
ab58683
Add temporary void/empty catch on signals, and fix templating errors
adam-parker1 Dec 2, 2025
93a7909
Reverse index/column ordering in uda_data_source set_data
adam-parker1 Dec 2, 2025
0e3e5ce
Merge branch 'feature/ext-libtokamap' of github.com:ukaea/JSON-mappin…
adam-parker1 Dec 2, 2025
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
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Checks: "*,
-cppcoreguidelines-pro-type-reinterpret-cast,
-altera-struct-pack-align,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-hicpp-no-array-decay
-readability-identifier-naming
-hicpp-no-array-decay,
-readability-identifier-naming,
"
CheckOptions:
misc-non-private-member-variables-in-classes: IgnoreClassesWithAllMemberVariablesBeingPublic
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build & Test

on:
push:
branches:
- main
- develop
- "feature/**"
- "release/**"
pull_request:
branches:
- main

jobs:
build:
strategy:
matrix:
# os: [ubuntu-22.04, windows-latest, macos-latest]
os: [ubuntu-latest, macos-latest]
release: [Debug, Release]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt update && sudo apt install -y libboost-dev

- name: Install macos dependencies
if: matrix.os == 'macos-latest'
run: brew update-reset && brew install boost

# - name: Configure CMake
# run: >
# cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.release }} -DENABLE_TESTING=ON -DENABLE_EXAMPLES=ON

# - name: Build
# run: cmake --build build --config ${{ matrix.release }}

# - name: Install
# if: matrix.os != 'windows-latest'
# run: sudo cmake --install build --config ${{ matrix.release }}

# # - name: Install
# # if: matrix.os == 'windows-latest'
# # run: cmake --install build --config ${{ matrix.release }}

# - name: Test
# run: ctest --test-dir build --output-on-failure

# - name: Examples
# run: ./build/libtokamap/examples/simple_mapper/simple_mapper
44 changes: 9 additions & 35 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
# Build & Install
build*/*
install/*

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
build*
install
cmake-build-*
Testing
venv
.ropeproject

# Machine dependent compile commands
compile_commands.json

# Compiler cache (clangd)
.cache
.clangd
.idea
.zed
119 changes: 48 additions & 71 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,96 +1,73 @@
cmake_minimum_required( VERSION 3.15 )

#
# Project details
#
project(
JSONMappingPlugin
VERSION 0.1.0
VERSION 0.2.0.0
LANGUAGES CXX
)

#
# Extra cmake modules to find libraries
#
set( CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_SOURCE_DIR}/cmake/Modules
list(
APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_SOURCE_DIR}/cmake/Modules
)

find_package( Boost CONFIG )
find_package( UDA 2.7.0 REQUIRED )
# Specify C++ standard for all targets
set( CMAKE_CXX_STANDARD 20 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_CXX_EXTENSIONS OFF )

#
# Set project options
#
include( StandardSettings )
include( StaticAnalyzers )
include( Utils )

add_clang_format_target()

message( STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}" )
# Export compile commands for tools like clang-tidy
set( CMAKE_EXPORT_COMPILE_COMMANDS ON )

if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE "Debug" )
# Set default build type if not specified
if( NOT CMAKE_BUILD_TYPE)
set( CMAKE_BUILD_TYPE "Debug" )
endif()

message( STATUS "Started CMake for ${PROJECT_NAME} v${PROJECT_VERSION}...\n" )

#
# Prevent building in the source directory
#
if( PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR )
message( FATAL_ERROR "In-source builds not allowed.
Please make a new directory (called a build directory)
and run CMake from there.\n" )
if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR )
message( FATAL_ERROR "In-source builds not allowed.
Please make a new directory (called a build directory)
and run CMake from there.\n" )
endif()

set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -pthread" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread" )

#
# Create module
#
configure_file(
${CMAKE_SOURCE_DIR}/JSON_mapping_plugin/etc/module.in
${CMAKE_BINARY_DIR}/etc/JSON_mapping_plugin/${PROJECT_VERSION}
@ONLY
)
# Find dependencies using modern approach
if( POLICY CMP0167 )
cmake_policy( SET CMP0167 NEW )
endif()

set( MODULE_PATH "modulefiles/JSON_mapping_plugin" CACHE PATH "location to install module files to" )
set( MODULE_NAME "${PROJECT_VERSION}" CACHE STRING "name of the module file" )
string( CONFIGURE "${MODULE_PATH}" MODULE_PATH_EXPANDED @ONLY )
# Set project options
include( StaticAnalyzers )
include( Utils )

get_filename_component(
MODULE_PATH_EXPANDED ${MODULE_PATH_EXPANDED}
REALPATH BASE_DIR "${CMAKE_INSTALL_PREFIX}"
)
option( ENABLE_TESTING "Enable unit tests for the project (from the `test` subfolder)." OFF )
option( ENABLE_PROFILING "Enable profiling for the project." OFF )
option( FETCH_LIBTOKAMAP "Fetch libtokamap as a dependency." OFF )

install(
FILES ${CMAKE_BINARY_DIR}/etc/JSON_mapping_plugin/${PROJECT_VERSION}
DESTINATION ${MODULE_PATH_EXPANDED}
RENAME ${MODULE_NAME}
)
# add_clang_format_target()

# Add JSON_mapping_plugin add_subdirectory
add_subdirectory( JSON_mapping_plugin )
if( ENABLE_TESTING )
enable_testing()
endif()

# This list is appended to by the uda_plugin macro
set( BUILT_PLUGINS "${PLUGINS}" )
message( STATUS "PLUGINS: ${PLUGINS}" )
if( FETCH_LIBTOKAMAP )
include( FetchContent )
FetchContent_Declare(
libtokamap
GIT_REPOSITORY https://github.com/ukaea/libtokamap.git
GIT_TAG develop
CMAKE_ARGS -DENABLE_TESTS=OFF -DENABLE_PROFILING=${ENABLE_PROFILING}
)

FetchContent_MakeAvailable( libtokamap )
else()
add_clang_format_target()
endif()

#
# Generate scripts
#
string( REGEX REPLACE ";" " " PLUGINS "${BUILT_PLUGINS}" )
configure_file(
${CMAKE_SOURCE_DIR}/scripts/activate-plugins.sh.in
${CMAKE_BINARY_DIR}/scripts/activate-plugins.sh
@ONLY
)
configure_file(
${CMAKE_SOURCE_DIR}/scripts/remove-plugins.sh.in
${CMAKE_BINARY_DIR}/scripts/remove-plugins.sh
@ONLY
)
find_package( UDA REQUIRED )
add_subdirectory( mapping_plugin )
82 changes: 0 additions & 82 deletions JSON_mapping_plugin/CMakeLists.txt

This file was deleted.

9 changes: 0 additions & 9 deletions JSON_mapping_plugin/config/json_mapping.cfg.in

This file was deleted.

Loading