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

Python module: openPMD -> openpmd_api #380

Merged
merged 2 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ build_script:

test_script:
- cmd: ctest -V -C %CONFIGURATION%
- cmd: python -c "import openPMD; print(openPMD.__version__)"
- cmd: python -c "import openpmd_api; print(openpmd_api.__version__)"
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Compile-able/executable code example to reproduce the problem:

Python:
```python
import openPMD
import openpmd_api

# ...
```
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Example: I always do the following workflow [...]
Don't be afraid to add code examples!
Python:
```python
import openPMD
import openpmd_api

# ...
```
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ about: Anything unclear or not well documented
Don't be afraid to add code examples!
Python:
```python
import openPMD
import openpmd_api

# ...
```
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Changelog
=========

0.6.3-alpha
0.7.0-alpha
-----------
**Date:** TBA

Expand All @@ -19,6 +19,7 @@ Features

- Python:

- ``import openPMD`` renamed to ``import openpmd_api`` #380
- works with Python 3.7 #376
- setup.py for sdist #240

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ if(openPMD_HAVE_PYTHON)
CACHE PATH "Build directory for python modules"
)
set_target_properties(openPMD.py PROPERTIES
ARCHIVE_OUTPUT_NAME openPMD
LIBRARY_OUTPUT_NAME openPMD
ARCHIVE_OUTPUT_NAME openpmd_api
LIBRARY_OUTPUT_NAME openpmd_api
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PYTHON_OUTPUT_DIRECTORY}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ for( auto const& i : s.iterations ) {


```py
import openPMD
import openpmd_api

# ...

series = openPMD.Series("samples/git-sample/data%T.h5", openPMD.Access_Type.read_only)
series = openpmd_api.Series("samples/git-sample/data%T.h5", openPMD.Access_Type.read_only)

for k_i, i in series.iterations.items():
print("Iteration: {0}".format(k_i))
Expand Down
2 changes: 1 addition & 1 deletion docs/source/usage/firststeps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ Python

.. code-block:: python3

import openPMD
import openpmd_api
6 changes: 3 additions & 3 deletions examples/2_read_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
Authors: Axel Huebl
License: LGPLv3+
"""
import openPMD
import openpmd_api


if __name__ == "__main__":
series = openPMD.Series("../samples/git-sample/data%T.h5",
openPMD.Access_Type.read_only)
series = openpmd_api.Series("../samples/git-sample/data%T.h5",
openpmd_api.Access_Type.read_only)
print("Read a Series with openPMD standard version %s" %
series.openPMD)

Expand Down
14 changes: 7 additions & 7 deletions examples/3_write_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Authors: Axel Huebl
License: LGPLv3+
"""
import openPMD
import openpmd_api
import numpy as np


Expand All @@ -21,21 +21,21 @@
size, size))

# open file for writing
series = openPMD.Series(
series = openpmd_api.Series(
"../samples/3_write_serial_py.h5",
openPMD.Access_Type.create
openpmd_api.Access_Type.create
)

print("Created an empty {0} Series".format(series.iteration_encoding))

print(len(series.iterations))
rho = series.iterations[1]. \
meshes["rho"][openPMD.Mesh_Record_Component.SCALAR]
meshes["rho"][openpmd_api.Mesh_Record_Component.SCALAR]

datatype = openPMD.Datatype.DOUBLE
# datatype = openPMD.determineDatatype(global_data)
datatype = openpmd_api.Datatype.DOUBLE
# datatype = openpmd_api.determineDatatype(global_data)
extent = [size, size]
dataset = openPMD.Dataset(datatype, extent)
dataset = openpmd_api.Dataset(datatype, extent)

print("Created a Dataset of size {0}x{1} and Datatype {2}".format(
dataset.extent[0], dataset.extent[1], dataset.dtype))
Expand Down
2 changes: 1 addition & 1 deletion examples/7_extended_write_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Authors: Axel Huebl, Fabian Koller
License: LGPLv3+
"""
from openPMD import Series, Access_Type, Dataset, Mesh_Record_Component, \
from openpmd_api import Series, Access_Type, Dataset, Mesh_Record_Component, \
Unit_Dimension
import numpy as np

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@ def build_extension(self, ext):
description='C++ & Python API for Scientific I/O with openPMD',
long_description=long_description,
long_description_content_type='text/markdown',
keywords=('openpmd openscience hdf5 adios mpi hpc research '
keywords=('openPMD openscience hdf5 adios mpi hpc research '
'file-format file-handling'),
url='https://www.openpmd.org',
url='https://www.openPMD.org',
project_urls={
'Documentation': 'https://openpmd-api.readthedocs.io',
'Doxygen': 'https://www.openpmd.org/openPMD-api',
'Reference': 'https://doi.org/10.14278/rodare.27',
'Source': 'https://github.com/openPMD/openPMD-api',
'Tracker': 'https://github.com/openPMD/openPMD-api/issues',
},
ext_modules=[CMakeExtension('openPMD')],
ext_modules=[CMakeExtension('openpmd_api')],
cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,
python_requires='>=3.5, <3.8',
Expand Down
2 changes: 1 addition & 1 deletion src/binding/python/openPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void init_RecordComponent(py::module &);
void init_Series(py::module &);


PYBIND11_MODULE(openPMD, m) {
PYBIND11_MODULE(openpmd_api, m) {
// m.doc() = ...;

// note: order from parent to child classes
Expand Down
Loading