Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
  • Loading branch information
franzpoeschel and ax3l committed Jan 11, 2022
1 parent 212b4ec commit cc63e04
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/source/details/backendconfig.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _backendconfig:

JSON/TOML configuration
==================
=======================

While the openPMD API intends to be a backend-*independent* implementation of the openPMD standard, it is sometimes useful to pass configuration parameters to the specific backend in use.
:ref:`For each backend <backends-overview>`, configuration options can be passed via a JSON- or TOML-formatted string or via environment variables.
Expand Down
8 changes: 1 addition & 7 deletions examples/13_write_dynamic_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@
using std::cout;
using namespace openPMD;

bool hasAdios2()
{
auto variants = getVariants();
auto iterator = variants.find( "adios2" );
return iterator != variants.end() && iterator->second;
}

int main()
{
if( !hasAdios2() )
if( !getVariants()["adios2"] )
{
// Example configuration below selects the ADIOS2 backend
return 0;
Expand Down
6 changes: 1 addition & 5 deletions examples/13_write_dynamic_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
import numpy as np


def hasAdios2():
return 'adios2' in io.variants and io.variants['adios2']


# This example demonstrates how to use JSON/TOML-based dynamic
# configuration for openPMD.
# The following configuration is passed to the constructor of the Series
Expand Down Expand Up @@ -56,7 +52,7 @@ def hasAdios2():


def main():
if not hasAdios2():
if not io.variants['adios2']:
# Example configuration below selects the ADIOS2 backend
return

Expand Down

0 comments on commit cc63e04

Please sign in to comment.