Skip to content

Commit

Permalink
give mac-os artifacts a name and include tarball (#36)
Browse files Browse the repository at this point in the history
* give mac-os artifacts a name and include tarball

* test mac build

* update pre-commit; move dependabot to monthly updates

* disable env and permissions

* build mac only on release
  • Loading branch information
akaszynski committed Mar 29, 2024
1 parent 29e5d98 commit 1a1e967
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ updates:
directory: "/requirements" # Location of package manifests
insecure-external-code-execution: allow
schedule:
interval: "daily"
interval: "monthly"
labels:
- "Maintenance"
- "Dependencies"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "monthly"
6 changes: 4 additions & 2 deletions .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
name: mapdl-archive-wheel-${{ matrix.os }}

release:
name: Release
Expand All @@ -119,10 +120,11 @@ jobs:
- uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: Move wheels to dist
- name: Flatten directory structure
run: |
mkdir -p dist/
find . -name "*.whl" -exec mv {} dist/ \;
find . -name '*.whl' -exec mv {} dist/ \;
find . -name '*.tar.gz' -exec mv {} dist/ \;
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.3.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down Expand Up @@ -49,7 +49,7 @@ repos:
exclude: "tests/"

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.2
hooks:
- id: clang-format
files: |
Expand All @@ -58,7 +58,7 @@ repos:
)$
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
exclude: ^(doc/|tests)
Expand All @@ -77,6 +77,6 @@ repos:
exclude: '.*\.(cdb|rst|dat)$'

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.3
rev: 0.28.0
hooks:
- id: check-github-workflows
1 change: 1 addition & 0 deletions mapdl_archive/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MAPDL archive reader."""

from mapdl_archive import examples # noqa: F401
from mapdl_archive._version import __version__ # noqa: F401
from mapdl_archive.archive import ( # noqa: F401
Expand Down
1 change: 1 addition & 0 deletions mapdl_archive/archive.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module to read MAPDL ASCII block formatted CDB files."""

import io
import logging
import os
Expand Down
2 changes: 1 addition & 1 deletion mapdl_archive/cython/vtk_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ int ans_to_vtk(const int nelem, const int *elem, const int *elem_off,
add_line(build_offset, &elem[off], false);
// should never reach here
} // end of switch
} // end of loop
} // end of loop

/* printf("Done\n"); */

Expand Down
1 change: 1 addition & 0 deletions mapdl_archive/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
PLANE293
USER300
"""

from typing import List

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions mapdl_archive/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Examples module."""

from .examples import ( # noqa: F401
academic_rotor_archive_file,
hexarchivefile,
Expand Down
1 change: 1 addition & 0 deletions mapdl_archive/examples/examples.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mapdl-archive example files."""

import os

# get location of this folder and the example files
Expand Down
43 changes: 22 additions & 21 deletions mapdl_archive/mesh.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the Mesh class used by Archive."""

from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union, cast
import warnings
Expand Down Expand Up @@ -105,32 +106,32 @@ def __init__(
keyopt: Dict[int, List[List[int]]] = {},
):
"""Initialize the mesh."""
self._etype: Optional[
npt.NDArray[np.int32]
] = None # internal element type reference
self._etype: Optional[npt.NDArray[np.int32]] = (
None # internal element type reference
)
self._grid: Optional[UnstructuredGrid] = None
self._surf_cache: Optional[PolyData] = None # cached external surface
self._enum: Optional[npt.NDArray[np.int32]] = None # cached element numbering
self._etype_cache: Optional[
npt.NDArray[np.int32]
] = None # cached ansys ETYPE num
self._rcon: Optional[
npt.NDArray[np.int32]
] = None # ansys element real constant
self._mtype: Optional[
npt.NDArray[np.int32]
] = None # cached ansys material type
self._node_angles: Optional[
npt.NDArray[np.float64]
] = None # cached node angles
self._node_coord: Optional[
npt.NDArray[np.float64]
] = None # cached node coordinates
self._etype_cache: Optional[npt.NDArray[np.int32]] = (
None # cached ansys ETYPE num
)
self._rcon: Optional[npt.NDArray[np.int32]] = (
None # ansys element real constant
)
self._mtype: Optional[npt.NDArray[np.int32]] = (
None # cached ansys material type
)
self._node_angles: Optional[npt.NDArray[np.float64]] = (
None # cached node angles
)
self._node_coord: Optional[npt.NDArray[np.float64]] = (
None # cached node coordinates
)
self._cached_elements: Optional[List[npt.NDArray[np.int32]]] = None
self._secnum: Optional[npt.NDArray[np.int32]] = None # cached section number
self._esys: Optional[
npt.NDArray[np.int32]
] = None # cached element coordinate system
self._esys: Optional[npt.NDArray[np.int32]] = (
None # cached element coordinate system
)
self._etype_id: Optional[npt.NDArray[np.int32]] = None # cached element type id

# Always set on init
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Installation file for mapdl_archive."""

from io import open as io_open
import os

Expand Down
1 change: 1 addition & 0 deletions tests/test_archive.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test ``mapdl_archive/archive.py``."""

import os
import pathlib
import sys
Expand Down

0 comments on commit 1a1e967

Please sign in to comment.