Skip to content

Commit 31e3f33

Browse files
authored
Merge branch 'dev' into dev
2 parents e4ca3e6 + 46883e1 commit 31e3f33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+207
-71
lines changed

.github/workflows/tests.yml

+65-49
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,68 @@
1-
2-
name: 'Tests'
1+
name: CI_pyMAP
32

4-
on:
5-
push:
6-
7-
pull_request:
8-
types: [opened, synchronize] #labeled, assigned]
3+
# We run CI on push commits and pull requests on all branches
4+
on: [push, pull_request]
95

6+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
107
jobs:
11-
build-and-test:
12-
strategy:
13-
matrix:
14-
include:
15-
- os: ubuntu-18.04
16-
python-version: 3.7
17-
python: xvfb-run python3
18-
pip_arg: ""
19-
- os: ubuntu-18.04
20-
python-version: 3.8
21-
python: xvfb-run python3
22-
pip_arg: ""
23-
- os: macos-10.15
24-
python-version: 3.8
25-
python: python3
26-
pip_arg: ""
27-
- os: windows-2019
28-
python-version: 3.8
29-
python: python
30-
pip_arg: --user
31-
runs-on: ${{ matrix.os }}
32-
33-
34-
steps:
35-
- name: Checkout
36-
uses: actions/checkout@main
37-
with:
38-
submodules: recursive
39-
40-
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v2
42-
with:
43-
python-version: ${{ matrix.python-version }}
44-
45-
- name: Install python package
46-
run: |
47-
python -m pip install numpy
48-
python setup.py install
49-
50-
- name: Python unittests
51-
run: |
52-
python -m unittest discover -v
8+
build_pip:
9+
name: Pip Build (${{ matrix.os }}) - ${{ matrix.python-version }}
10+
runs-on: ${{ matrix.os }}
11+
defaults:
12+
run:
13+
shell: bash -l {0}
14+
15+
strategy:
16+
fail-fast: false #true
17+
matrix:
18+
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
19+
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
21+
steps:
22+
- name: Setup C/C++ Compiler
23+
id: install_cc
24+
uses: rlalik/[email protected]
25+
with:
26+
compiler: gcc #clang
27+
28+
- name: checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v4
33+
id: cp
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
update-environment: true
37+
38+
- name: Editable Pip Install pyMAP
39+
env:
40+
CC: '${{ steps.install_cc.outputs.cc }}'
41+
CXX: '${{ steps.install_cc.outputs.cxx }}'
42+
run: |
43+
'${{ steps.cp.outputs.python-path }}' -m pip install --upgrade pip
44+
'${{ steps.cp.outputs.python-path }}' -m pip install numpy setuptools
45+
'${{ steps.cp.outputs.python-path }}' -m pip install -e .
46+
47+
- name: Editable Test run
48+
run: |
49+
'${{ steps.cp.outputs.python-path }}' -m unittest discover -v
50+
51+
- name: Pip Install pyFrame3DD
52+
env:
53+
CC: '${{ steps.install_cc.outputs.cc }}'
54+
CXX: '${{ steps.install_cc.outputs.cxx }}'
55+
run: |
56+
'${{ steps.cp.outputs.python-path }}' -m pip uninstall pymap
57+
'${{ steps.cp.outputs.python-path }}' -m pip install -v .[test]
58+
59+
#- name: Setup tmate session
60+
# uses: mxschmitt/action-tmate@v3
61+
# with:
62+
# detached: true
63+
# if: contains( matrix.os, 'ubuntu')
64+
65+
- name: Test run
66+
run: |
67+
'${{ steps.cp.outputs.python-path }}' -m unittest discover -v
68+

license.txt LICENSE

File renamed without changes.

pymap/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from pymap.pymap import pyMAP
2+
File renamed without changes.

src/pymap/pymap.py pymap/pymap.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import os
3333

3434

35-
from distutils.sysconfig import get_config_var
35+
from sysconfig import get_config_var
3636

3737
from sys import platform
3838

@@ -310,7 +310,7 @@ def initLib(cls, dllFileName=None):
310310
libext = '.dll'
311311

312312
maplib = '_libmap' + libext
313-
dllFileName = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + os.path.sep + maplib
313+
dllFileName = os.path.dirname(os.path.abspath(__file__)) + os.path.sep + maplib
314314

315315
# Load the library and setup C-interfaces
316316
lib = setupLib(dllFileName)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/pymap/map.h pymap/src/map.h

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

pyproject.toml

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel","numpy"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "pymap"
7+
version = "1.1.0"
8+
description = "Python module wrapping around MAP++"
9+
readme = "README.md"
10+
requires-python = ">=3.9"
11+
license = {text = "Apache-2.0"}
12+
keywords = ["wind", "turbine", "mdao", "design", "optimization"]
13+
authors = [
14+
{name = "NREL WISDEM Team", email = "[email protected]" }
15+
]
16+
maintainers = [
17+
{name = "NREL WISDEM Team", email = "[email protected]" }
18+
]
19+
classifiers = [ # Optional
20+
# How mature is this project? Common values are
21+
# 3 - Alpha
22+
# 4 - Beta
23+
# 5 - Production/Stable
24+
"Development Status :: 4 - Beta",
25+
26+
# Indicate who your project is intended for
27+
"Intended Audience :: Science/Research",
28+
"Topic :: Scientific/Engineering",
29+
30+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
31+
32+
# Specify the Python versions you support here. In particular, ensure
33+
# that you indicate you support Python 3. These classifiers are *not*
34+
# checked by "pip install". See instead "python_requires" below.
35+
"Programming Language :: Python :: 3",
36+
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python :: 3.10",
38+
"Programming Language :: Python :: 3.11",
39+
"Programming Language :: Python :: 3.12",
40+
"Programming Language :: Python :: 3 :: Only",
41+
"Programming Language :: C",
42+
"Operating System :: Microsoft :: Windows",
43+
"Operating System :: POSIX :: Linux",
44+
"Operating System :: POSIX",
45+
"Operating System :: Unix",
46+
"Operating System :: MacOS",
47+
]
48+
49+
dependencies = [
50+
"numpy",
51+
"matplotlib",
52+
]
53+
54+
# List additional groups of dependencies here (e.g. development
55+
# dependencies). Users will be able to install these using the "extras"
56+
# syntax, for example:
57+
#
58+
# $ pip install sampleproject[dev]
59+
#
60+
# Similar to `dependencies` above, these must be valid existing
61+
# projects.
62+
#[project.optional-dependencies] # Optional
63+
#test = ["pytest"]
64+
65+
# List URLs that are relevant to your project
66+
#
67+
# This field corresponds to the "Project-URL" and "Home-Page" metadata fields:
68+
# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
69+
# https://packaging.python.org/specifications/core-metadata/#home-page-optional
70+
#
71+
# Examples listed include a pattern for specifying where the package tracks
72+
# issues, where the source is hosted, where to say thanks to the package
73+
# maintainers, and where to support the project financially. The key is
74+
# what's used to render the link text on PyPI.
75+
[project.urls] # Optional
76+
homepage = "https://github.com/WISDEM/pyMAP"
77+
source = "https://github.com/WISDEM/pyMAP"
78+
79+
# This is configuration specific to the `setuptools` build backend.
80+
# If you are using a different build backend, you will need to change this.
81+
[tool.setuptools]
82+
include-package-data = true
83+
zip-safe = false
84+
85+
#[tool.setuptools.packages]
86+
#find = {}
87+
88+
[tool.setuptools.packages.find]
89+
exclude = ["docs", "examples", "test"]
90+
namespaces = true
91+
92+
[tool.setuptools.package-data]
93+
# If there are data files included in your packages that need to be
94+
# installed, specify them here.
95+
"*" = ["*.txt", "*.md"]
96+
97+
[tool.black]
98+
line-length = 120
99+
target-version = ['py311']
100+
include = '\.pyi?$'
101+
exclude = '''
102+
/(
103+
\.git
104+
| \.hg
105+
| \.mypy_cache
106+
| \.tox
107+
| \.venv
108+
| _build
109+
| buck-out
110+
| build
111+
| dist
112+
)/
113+
'''
114+
115+
[tool.isort]
116+
# https://github.com/PyCQA/isort
117+
multi_line_output = "3"
118+
include_trailing_comma = true
119+
force_grid_wrap = false
120+
use_parentheses = true
121+
line_length = "120"
122+
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
123+
known_first_party = ["wisdem"]
124+
length_sort = "1"
125+
profile = "black"
126+
skip_glob = ['__init__.py']
127+
atomic = true
128+
#lines_after_imports = 2
129+
#lines_between_types = 1
130+
#src_paths=isort,test
131+
132+
[tool.cibuildwheel]
133+
skip = ["cp36-*", "cp37-*", "cp38-*", "*-win32"]
134+
build-frontend = "build"

setup.py

+4-19
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# encoding: utf-8
33

44
from setuptools import setup, Extension
5-
# from numpy.distutils.core import setup, Extension
65
import os
76
import sys
87
import platform
@@ -21,28 +20,14 @@
2120
#cflags = ['-O1', '-m64', '-fPIC', '-std=c99', '-D WITH_LAPACK']
2221
cflags = ['-O1', '-m64', '-fPIC', '-std=c99']
2322

24-
pymapExt = Extension('_libmap', sources=glob.glob(os.path.join('src','pymap','**','*.c'), recursive=True)+
25-
glob.glob(os.path.join('src','pymap','**','*.cc'), recursive=True),
23+
pymapExt = Extension('pymap._libmap',
24+
sources=glob.glob(os.path.join('pymap','src','**','*.c'), recursive=True)+
25+
glob.glob(os.path.join('pymap','src','**','*.cc'), recursive=True),
2626
extra_compile_args=cflags,
27-
include_dirs=[os.path.join('src','pymap','lapack')])
27+
include_dirs=[os.path.join('pymap','src','lapack')])
2828

2929
setup(
30-
name='pyMAP',
31-
version='1.0.0',
32-
description='Python module wrapping around MAP++',
33-
author='NREL WISDEM Team',
34-
author_email='[email protected]',
35-
license='Apache License, Version 2.0',
36-
package_dir={'': 'src'},
37-
py_modules=['pymap'+os.sep+'pymap'],
38-
package_data={'pymap': []},
39-
packages=['pymap'],
4030
ext_modules=[pymapExt],
41-
install_requires=[
42-
'matplotlib',
43-
'numpy',
44-
],
45-
zip_safe=False
4631
)
4732

4833

src/pymap/__init__.py

-1
This file was deleted.

0 commit comments

Comments
 (0)