Skip to content

Commit e322ea9

Browse files
committed
Add aliases
1 parent ebc3343 commit e322ea9

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

include/openPMD/IO/Access.hpp

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ enum class Access
6262
* If the dataset only has one single step, this is guaranteed to work
6363
* as expected. Otherwise, it is undefined which step's data is returned.
6464
*/
65-
READ_ONLY,
66-
READ_RANDOM_ACCESS = READ_ONLY, //!< more explicit alias for READ_ONLY
65+
READ_ONLY = 0,
6766
/*
6867
* Open Series as read-only, fails if Series is not found.
6968
* This access mode requires use of Series::readIterations().
@@ -72,17 +71,21 @@ enum class Access
7271
* become available by use of the returned Iterator, e.g. in a foreach loop.
7372
* See Access::READ_ONLY for when to use this.
7473
*/
75-
READ_LINEAR,
74+
READ_LINEAR = 1,
7675
/**
7776
* Open existing Series as writable.
7877
* Read mode corresponds with Access::READ_RANDOM_ACCESS.
7978
*/
80-
READ_WRITE,
81-
CREATE_RANDOM_ACCESS, //!< create new series and truncate existing (files)
82-
CREATE_LINEAR,
83-
APPEND_RANDOM_ACCESS, //!< write new iterations to an existing series
84-
//!< without reading
85-
APPEND_LINEAR
79+
READ_WRITE = 2,
80+
CREATE_RANDOM_ACCESS =
81+
3, //!< create new series and truncate existing (files)
82+
CREATE_LINEAR = 4,
83+
APPEND_RANDOM_ACCESS = 5, //!< write new iterations to an existing series
84+
//!< without reading
85+
APPEND_LINEAR = 6,
86+
READ_RANDOM_ACCESS = READ_ONLY, //!< more explicit alias for READ_ONLY
87+
CREATE = CREATE_RANDOM_ACCESS,
88+
APPEND = APPEND_RANDOM_ACCESS
8689
}; // Access
8790

8891
std::ostream &operator<<(std::ostream &o, Access const &a);

src/binding/python/Access.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,21 @@ as expected. Otherwise, it is undefined which step's data is returned.)")
7575
Access::CREATE_RANDOM_ACCESS,
7676
"create new series and truncate existing (files), use "
7777
"random-access for interacting with snapshots")
78+
.value(
79+
"create",
80+
Access::CREATE,
81+
"create new series and truncate existing (files), use "
82+
"random-access for interacting with snapshots")
7883
.value(
7984
"append_random_access",
8085
Access::APPEND_RANDOM_ACCESS,
8186
"write new iterations to an existing series without reading, use "
8287
"random-access for interacting with snapshots")
88+
.value(
89+
"append",
90+
Access::APPEND,
91+
"write new iterations to an existing series without reading, use "
92+
"random-access for interacting with snapshots")
8393
.value(
8494
"create_linear",
8595
Access::CREATE_LINEAR,

0 commit comments

Comments
 (0)