Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter authored Apr 15, 2024
2 parents e4ca3e6 + 46883e1 commit 31e3f33
Show file tree
Hide file tree
Showing 50 changed files with 207 additions and 71 deletions.
114 changes: 65 additions & 49 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,68 @@

name: 'Tests'
name: CI_pyMAP

on:
push:

pull_request:
types: [opened, synchronize] #labeled, assigned]
# We run CI on push commits and pull requests on all branches
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-and-test:
strategy:
matrix:
include:
- os: ubuntu-18.04
python-version: 3.7
python: xvfb-run python3
pip_arg: ""
- os: ubuntu-18.04
python-version: 3.8
python: xvfb-run python3
pip_arg: ""
- os: macos-10.15
python-version: 3.8
python: python3
pip_arg: ""
- os: windows-2019
python-version: 3.8
python: python
pip_arg: --user
runs-on: ${{ matrix.os }}


steps:
- name: Checkout
uses: actions/checkout@main
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install python package
run: |
python -m pip install numpy
python setup.py install
- name: Python unittests
run: |
python -m unittest discover -v
build_pip:
name: Pip Build (${{ matrix.os }}) - ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false #true
matrix:
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Setup C/C++ Compiler
id: install_cc
uses: rlalik/[email protected]
with:
compiler: gcc #clang

- name: checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: cp
with:
python-version: ${{ matrix.python-version }}
update-environment: true

- name: Editable Pip Install pyMAP
env:
CC: '${{ steps.install_cc.outputs.cc }}'
CXX: '${{ steps.install_cc.outputs.cxx }}'
run: |
'${{ steps.cp.outputs.python-path }}' -m pip install --upgrade pip
'${{ steps.cp.outputs.python-path }}' -m pip install numpy setuptools
'${{ steps.cp.outputs.python-path }}' -m pip install -e .
- name: Editable Test run
run: |
'${{ steps.cp.outputs.python-path }}' -m unittest discover -v
- name: Pip Install pyFrame3DD
env:
CC: '${{ steps.install_cc.outputs.cc }}'
CXX: '${{ steps.install_cc.outputs.cxx }}'
run: |
'${{ steps.cp.outputs.python-path }}' -m pip uninstall pymap
'${{ steps.cp.outputs.python-path }}' -m pip install -v .[test]
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# detached: true
# if: contains( matrix.os, 'ubuntu')

- name: Test run
run: |
'${{ steps.cp.outputs.python-path }}' -m unittest discover -v
File renamed without changes.
2 changes: 2 additions & 0 deletions pymap/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from pymap.pymap import pyMAP

File renamed without changes.
4 changes: 2 additions & 2 deletions src/pymap/pymap.py → pymap/pymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import os


from distutils.sysconfig import get_config_var
from sysconfig import get_config_var

from sys import platform

Expand Down Expand Up @@ -310,7 +310,7 @@ def initLib(cls, dllFileName=None):
libext = '.dll'

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

# Load the library and setup C-interfaces
lib = setupLib(dllFileName)
Expand Down
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.
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.
134 changes: 134 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
[build-system]
requires = ["setuptools", "wheel","numpy"]
build-backend = "setuptools.build_meta"

[project]
name = "pymap"
version = "1.1.0"
description = "Python module wrapping around MAP++"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "Apache-2.0"}
keywords = ["wind", "turbine", "mdao", "design", "optimization"]
authors = [
{name = "NREL WISDEM Team", email = "[email protected]" }
]
maintainers = [
{name = "NREL WISDEM Team", email = "[email protected]" }
]
classifiers = [ # Optional
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 4 - Beta",

# Indicate who your project is intended for
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",

"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",

# Specify the Python versions you support here. In particular, ensure
# that you indicate you support Python 3. These classifiers are *not*
# checked by "pip install". See instead "python_requires" below.
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: C",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
]

dependencies = [
"numpy",
"matplotlib",
]

# List additional groups of dependencies here (e.g. development
# dependencies). Users will be able to install these using the "extras"
# syntax, for example:
#
# $ pip install sampleproject[dev]
#
# Similar to `dependencies` above, these must be valid existing
# projects.
#[project.optional-dependencies] # Optional
#test = ["pytest"]

# List URLs that are relevant to your project
#
# This field corresponds to the "Project-URL" and "Home-Page" metadata fields:
# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
# https://packaging.python.org/specifications/core-metadata/#home-page-optional
#
# Examples listed include a pattern for specifying where the package tracks
# issues, where the source is hosted, where to say thanks to the package
# maintainers, and where to support the project financially. The key is
# what's used to render the link text on PyPI.
[project.urls] # Optional
homepage = "https://github.com/WISDEM/pyMAP"
source = "https://github.com/WISDEM/pyMAP"

# This is configuration specific to the `setuptools` build backend.
# If you are using a different build backend, you will need to change this.
[tool.setuptools]
include-package-data = true
zip-safe = false

#[tool.setuptools.packages]
#find = {}

[tool.setuptools.packages.find]
exclude = ["docs", "examples", "test"]
namespaces = true

[tool.setuptools.package-data]
# If there are data files included in your packages that need to be
# installed, specify them here.
"*" = ["*.txt", "*.md"]

[tool.black]
line-length = 120
target-version = ['py311']
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[tool.isort]
# https://github.com/PyCQA/isort
multi_line_output = "3"
include_trailing_comma = true
force_grid_wrap = false
use_parentheses = true
line_length = "120"
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_first_party = ["wisdem"]
length_sort = "1"
profile = "black"
skip_glob = ['__init__.py']
atomic = true
#lines_after_imports = 2
#lines_between_types = 1
#src_paths=isort,test

[tool.cibuildwheel]
skip = ["cp36-*", "cp37-*", "cp38-*", "*-win32"]
build-frontend = "build"
23 changes: 4 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# encoding: utf-8

from setuptools import setup, Extension
# from numpy.distutils.core import setup, Extension
import os
import sys
import platform
Expand All @@ -21,28 +20,14 @@
#cflags = ['-O1', '-m64', '-fPIC', '-std=c99', '-D WITH_LAPACK']
cflags = ['-O1', '-m64', '-fPIC', '-std=c99']

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

setup(
name='pyMAP',
version='1.0.0',
description='Python module wrapping around MAP++',
author='NREL WISDEM Team',
author_email='[email protected]',
license='Apache License, Version 2.0',
package_dir={'': 'src'},
py_modules=['pymap'+os.sep+'pymap'],
package_data={'pymap': []},
packages=['pymap'],
ext_modules=[pymapExt],
install_requires=[
'matplotlib',
'numpy',
],
zip_safe=False
)


1 change: 0 additions & 1 deletion src/pymap/__init__.py

This file was deleted.

0 comments on commit 31e3f33

Please sign in to comment.