Skip to content
Open
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
10 changes: 0 additions & 10 deletions .bumpversion.toml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ __pycache__/
*$py.class

# C extensions
*.cmake
*.so

# Distribution / packaging
Expand Down
176 changes: 88 additions & 88 deletions examples/Atlas4Py-Test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"metadata": {},
"outputs": [],
"source": [
"import _atlas4py"
"import atlas4py"
]
},
{
Expand All @@ -37,22 +37,22 @@
"name": "stdout",
"output_type": "stream",
"text": [
"_atlas4py.Grid({'domain': {'type': 'rectangular', 'units': 'degrees', 'xmax': 1.0, 'xmin': -1.0, 'ymax': 1.0, 'ymin': -1.0}, 'projection': {'type': 'lonlat'}, 'type': 'structured', 'xspace': {'N': 20, 'end': 1.0, 'endpoint': True, 'start': -1.0, 'type': 'linear'}, 'yspace': {'N': 21, 'end': 1.0, 'endpoint': True, 'start': -1.0, 'type': 'linear'}})\n",
"<_atlas4py.functionspace.CellColumns object at 0x7f32bfd1efb0>\n"
"_atlas4py.Grid({'type': 'structured', 'xspace': {'type': 'linear', 'start': -1.0, 'end': 1.0, 'N': 20, 'endpoint': True}, 'yspace': {'type': 'linear', 'start': -1.0, 'end': 1.0, 'N': 21, 'endpoint': True}, 'domain': {'type': 'rectangular', 'xmin': -1.0, 'xmax': 1.0, 'ymin': -1.0, 'ymax': 1.0, 'units': 'degrees'}, 'projection': {'type': 'lonlat'}})\n",
"<atlas4py._atlas4py.functionspace.CellColumns object at 0x104105a10>\n"
]
}
],
"source": [
"#grid = _atlas4py.StructuredGrid(\"L32x32\")\n",
"#grid = _atlas4py.StructuredGrid(x_spacings=[_atlas4py.LinearSpacing(-1, 1, 21)]*15 + [_atlas4py.LinearSpacing(-1, 1, 15)]*6,\n",
"# y_spacing=_atlas4py.LinearSpacing(-1, 1, 21))\n",
"grid = _atlas4py.StructuredGrid(x_spacing=_atlas4py.LinearSpacing(-1, 1, 20),\n",
" y_spacing=_atlas4py.LinearSpacing(-1, 1, 21))\n",
"#grid = atlas4py.StructuredGrid(\"L32x32\")\n",
"#grid = atlas4py.StructuredGrid(x_spacings=[atlas4py.LinearSpacing(-1, 1, 21)]*15 + [atlas4py.LinearSpacing(-1, 1, 15)]*6,\n",
"# y_spacing=atlas4py.LinearSpacing(-1, 1, 21))\n",
"grid = atlas4py.StructuredGrid(x_spacing=atlas4py.LinearSpacing(-1, 1, 20),\n",
" y_spacing=atlas4py.LinearSpacing(-1, 1, 21))\n",
"print(grid)\n",
"mesh = _atlas4py.StructuredMeshGenerator().generate(grid)\n",
"_atlas4py.build_edges(mesh)\n",
"_atlas4py.build_node_to_edge_connectivity(mesh)\n",
"fs = _atlas4py.functionspace.CellColumns(mesh)\n",
"mesh = atlas4py.StructuredMeshGenerator().generate(grid)\n",
"atlas4py.build_edges(mesh)\n",
"atlas4py.build_node_to_edge_connectivity(mesh)\n",
"fs = atlas4py.functionspace.CellColumns(mesh)\n",
"print(fs)"
]
},
Expand All @@ -79,8 +79,8 @@
"metadata": {},
"outputs": [],
"source": [
"out_view = np.array(out_f, copy=False)\n",
"in_view = np.array(in_f, copy=False)\n",
"out_view = np.asarray(out_f)\n",
"in_view = np.asarray(in_f)\n",
"out_view[:] = in_view[:] = np.zeros_like(in_view)"
]
},
Expand All @@ -90,7 +90,7 @@
"metadata": {},
"outputs": [],
"source": [
"lonlat_view = np.array(mesh.nodes.lonlat, copy=False)\n",
"lonlat_view = np.asarray(mesh.nodes.lonlat)\n",
"lonlat0 = lonlat_view[0]\n",
"lonlat1 = lonlat_view[-1]"
]
Expand Down Expand Up @@ -133,7 +133,7 @@
"source": [
"!rm out.msh\n",
"import computation\n",
"with _atlas4py.Gmsh(\"out.msh\") as out:\n",
"with atlas4py.Gmsh(\"out.msh\") as out:\n",
" out.write(mesh)\n",
" for i in range(100):\n",
" in_f.metadata[\"step\"] = i\n",
Expand All @@ -156,12 +156,12 @@
"metadata": {},
"outputs": [],
"source": [
"grid = _atlas4py.StructuredGrid(x_spacing=_atlas4py.LinearSpacing(-1, 1, 5),\n",
" y_spacing=_atlas4py.LinearSpacing(-1, 1, 5))\n",
"mesh = _atlas4py.StructuredMeshGenerator().generate(grid)\n",
"_atlas4py.build_edges(mesh)\n",
"_atlas4py.build_node_to_edge_connectivity(mesh)\n",
"fs = _atlas4py.functionspace.CellColumns(mesh, halo=2)"
"grid = atlas4py.StructuredGrid(x_spacing=atlas4py.LinearSpacing(-1, 1, 5),\n",
" y_spacing=atlas4py.LinearSpacing(-1, 1, 5))\n",
"mesh = atlas4py.StructuredMeshGenerator().generate(grid)\n",
"atlas4py.build_edges(mesh)\n",
"atlas4py.build_node_to_edge_connectivity(mesh)\n",
"fs = atlas4py.functionspace.CellColumns(mesh, halo=2)"
]
},
{
Expand Down Expand Up @@ -265,7 +265,7 @@
}
],
"source": [
"lonlat_view = np.array(mesh.nodes.lonlat, copy=False)\n",
"lonlat_view = np.asarray(mesh.nodes.lonlat)\n",
"lonlat_view"
]
},
Expand All @@ -283,45 +283,45 @@
"block: 0\n",
"40 x 2\n",
"[[5, 0],\n",
" [5, 6],\n",
" [6, 1],\n",
" [0, 1],\n",
" [6, 7],\n",
" [7, 2],\n",
" [6, 1],\n",
" [5, 6],\n",
" [1, 2],\n",
" [7, 8],\n",
" [8, 3],\n",
" [7, 2],\n",
" [6, 7],\n",
" [2, 3],\n",
" [8, 9],\n",
" [9, 4],\n",
" [8, 3],\n",
" [7, 8],\n",
" [3, 4],\n",
" [9, 4],\n",
" [8, 9],\n",
" [10, 5],\n",
" [10, 11],\n",
" [11, 6],\n",
" [11, 12],\n",
" [10, 11],\n",
" [12, 7],\n",
" [12, 13],\n",
" [11, 12],\n",
" [13, 8],\n",
" [13, 14],\n",
" [12, 13],\n",
" [14, 9],\n",
" [13, 14],\n",
" [15, 10],\n",
" [15, 16],\n",
" [16, 11],\n",
" [16, 17],\n",
" [15, 16],\n",
" [17, 12],\n",
" [17, 18],\n",
" [16, 17],\n",
" [18, 13],\n",
" [18, 19],\n",
" [17, 18],\n",
" [19, 14],\n",
" [18, 19],\n",
" [20, 15],\n",
" [20, 21],\n",
" [21, 16],\n",
" [21, 22],\n",
" [20, 21],\n",
" [22, 17],\n",
" [22, 23],\n",
" [21, 22],\n",
" [23, 18],\n",
" [23, 24],\n",
" [24, 19]]\n",
" [22, 23],\n",
" [24, 19],\n",
" [23, 24]]\n",
"--- \n"
]
}
Expand Down Expand Up @@ -358,22 +358,22 @@
"\n",
"block: 0\n",
"16 x 4\n",
"[[0, 5, 6, 1],\n",
" [1, 6, 7, 2],\n",
" [2, 7, 8, 3],\n",
" [3, 8, 9, 4],\n",
" [5, 10, 11, 6],\n",
" [6, 11, 12, 7],\n",
" [7, 12, 13, 8],\n",
" [8, 13, 14, 9],\n",
" [10, 15, 16, 11],\n",
" [11, 16, 17, 12],\n",
" [12, 17, 18, 13],\n",
" [13, 18, 19, 14],\n",
" [15, 20, 21, 16],\n",
" [16, 21, 22, 17],\n",
" [17, 22, 23, 18],\n",
" [18, 23, 24, 19]]\n",
"[[5, 0, 1, 6],\n",
" [6, 1, 2, 7],\n",
" [7, 2, 3, 8],\n",
" [8, 3, 4, 9],\n",
" [10, 5, 6, 11],\n",
" [11, 6, 7, 12],\n",
" [12, 7, 8, 13],\n",
" [13, 8, 9, 14],\n",
" [15, 10, 11, 16],\n",
" [16, 11, 12, 17],\n",
" [17, 12, 13, 18],\n",
" [18, 13, 14, 19],\n",
" [20, 15, 16, 21],\n",
" [21, 16, 17, 22],\n",
" [22, 17, 18, 23],\n",
" [23, 18, 19, 24]]\n",
"--- \n",
"\n",
"block: 1\n",
Expand Down Expand Up @@ -452,31 +452,31 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[0, 3],\n",
" [2, 3, 6],\n",
" [5, 6, 9],\n",
" [8, 9, 12],\n",
" [11, 12],\n",
" [13, 1, 0],\n",
" [15, 1, 4, 2],\n",
" [17, 4, 7, 5],\n",
" [19, 7, 10, 8],\n",
" [21, 10, 11],\n",
" [22, 14, 13],\n",
" [24, 14, 16, 15],\n",
" [26, 16, 18, 17],\n",
" [28, 18, 20, 19],\n",
" [30, 20, 21],\n",
" [31, 23, 22],\n",
" [33, 23, 25, 24],\n",
" [35, 25, 27, 26],\n",
" [37, 27, 29, 28],\n",
" [39, 29, 30],\n",
" [32, 31],\n",
" [32, 34, 33],\n",
" [34, 36, 35],\n",
" [36, 38, 37],\n",
" [38, 39]]\n"
"[[0, 1],\n",
" [2, 1, 4],\n",
" [5, 4, 7],\n",
" [8, 7, 10],\n",
" [11, 10],\n",
" [13, 3, 0],\n",
" [14, 3, 6, 2],\n",
" [16, 6, 9, 5],\n",
" [18, 9, 12, 8],\n",
" [20, 12, 11],\n",
" [22, 15, 13],\n",
" [23, 15, 17, 14],\n",
" [25, 17, 19, 16],\n",
" [27, 19, 21, 18],\n",
" [29, 21, 20],\n",
" [31, 24, 22],\n",
" [32, 24, 26, 23],\n",
" [34, 26, 28, 25],\n",
" [36, 28, 30, 27],\n",
" [38, 30, 29],\n",
" [33, 31],\n",
" [33, 35, 32],\n",
" [35, 37, 34],\n",
" [37, 39, 36],\n",
" [39, 38]]\n"
]
}
],
Expand All @@ -494,19 +494,19 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"_atlas4py.Metadata({'bool': True, 'float': 3.12, 'global': False, 'int': 3, 'levels': 1, 'name': 'my_field', 'step': 98, 'str': 'x', 'variables': 0})\n",
"_atlas4py.Metadata({'name': 'my_field', 'levels': 1, 'variables': 0, 'global': False})\n",
"True\n",
"3\n",
"3.12\n",
"x\n",
"_atlas4py.Metadata({'bool': True, 'float': 3.12, 'global': False, 'int': 3, 'levels': 1, 'name': 'my_field', 'step': 98, 'str': 'x', 'variables': 0})\n"
"_atlas4py.Metadata({'name': 'my_field', 'levels': 1, 'variables': 0, 'global': False, 'bool': True, 'int': 3, 'float': 3.12, 'str': 'x'})\n"
]
}
],
Expand Down
15 changes: 12 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies = [

description = 'Python bindings for Atlas: a ECMWF library for parallel data-structures'
name = 'atlas4py'
version = '0.41.1.dev1'
version = '0.41.1.dev2' # <major>.<minor>.<patch>.dev<dev> : <atlas.major>.<atlas.minor>.<atlas.patch>.dev<atlas4py.dev>
license = {text = "Apache License 2.0"}
readme = {file = 'README.md', content-type = 'text/markdown'}
authors = [{email = 'willem.deconinck@ecmwf.int'}, {name = 'Willem Deconinck'}]
Expand All @@ -41,15 +41,15 @@ test = ['pytest', 'pytest-cache']

[tool.scikit-build]
minimum-version = '0.5'
build-dir="build/{wheel_tag}"
cmake.minimum-version = '3.25'
cmake.verbose = true
cmake.source-dir = "src/atlas4py"
cmake.build-type = "Release"
cmake.args = [
"-DATLAS4PY_ECBUILD_VERSION=3.9.1",
"-DATLAS4PY_ECKIT_VERSION=1.28.6",
"-DATLAS4PY_ATLAS_VERSION=0.41.1",
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=build",
"-DATLAS4PY_ATLAS_VERSION=0.41.1"
]
wheel.expand-macos-universal-tags = true
wheel.install-dir = "atlas4py"
Expand All @@ -75,3 +75,12 @@ exclude = '''
| dist
)/
'''

[tool.bumpversion]
# To update atlas4py dev version:
# pip install bump-my-version
# bump-my-version bump dev
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.dev(?P<dev>\\d+))?"
serialize = ["{major}.{minor}.{patch}.dev{dev}"]
[[tool.bumpversion.files]]
filename = "pyproject.toml"
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
black>=21.12b0
bump2version>=1.0
bump-my-version>=1.2.6
numpy>=1.17
pytest>=6.1
tox>=4.0
Expand Down
Loading
Loading