From 62d6205ca18677344c9f3b994f1166b66f1e4ddc Mon Sep 17 00:00:00 2001 From: Rounak Singh Date: Mon, 4 Dec 2017 19:24:12 -0500 Subject: [PATCH 01/34] submodule necpp: updated to commit 0af22b1... --- necpp_src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/necpp_src b/necpp_src index a033992..0af22b1 160000 --- a/necpp_src +++ b/necpp_src @@ -1 +1 @@ -Subproject commit a0339925a6fafa29c5b6d9a04bcfd3d406ad7ea3 +Subproject commit 0af22b10d5b8e96da412009ef1178f1b4131cbb8 From a27ed937f79498e7ada9f73b4bd1344d6370cd56 Mon Sep 17 00:00:00 2001 From: Rounak Singh Date: Tue, 5 Dec 2017 01:15:36 -0500 Subject: [PATCH 02/34] setup.py upgraded to setuptools -- Issue #7. config.h dir added for 32-bit. Readme updated. --- PyNEC/.gitignore | 3 +++ PyNEC/README.md | 43 ++++++++++++++++++++++++++++++++----------- PyNEC/build.sh | 3 ++- PyNEC/setup.py | 27 ++++++++++++--------------- 4 files changed, 49 insertions(+), 27 deletions(-) diff --git a/PyNEC/.gitignore b/PyNEC/.gitignore index a713962..f0766ac 100644 --- a/PyNEC/.gitignore +++ b/PyNEC/.gitignore @@ -1,2 +1,5 @@ build/** *.pyc +PyNEC.py +*.cxx +*.png \ No newline at end of file diff --git a/PyNEC/README.md b/PyNEC/README.md index 56bc5fa..837a7db 100644 --- a/PyNEC/README.md +++ b/PyNEC/README.md @@ -1,7 +1,7 @@ # Python NEC2++ Module -This module wraps the C++ API for antenna simulation of nec2++. It is easier to work with, and more powerful -than the C-style API wrapper. +This module wraps the C++ API for antenna simulation of nec2++. It is easier to work with, and more powerful than the C-style API wrapper. Works with Python 2.7 and 3+. + ## Usage @@ -52,21 +52,42 @@ Here is an example that plots a radiation pattern. plt.savefig('RadiationPattern.png') plt.show() +## Build + +Requirements + +* [Pandoc](https://pandoc.org/) +* [Swig](http://www.swig.org/) +* configure & make +* pip +* setuptools +* wheel +*Note: For Windows: Compling requires [C/C++ compliers](https://wiki.python.org/moin/WindowsCompilers). Also, add the path to swig.exe to environment.* + + + $ git clone --recursive https://github.com/tmolteno/python-necpp.git + $ cd python-necpp + $ cd PyNEC + $ ./build.sh + $ python setup.py bdist_wheel + $ sudo python setup.py install + + *Note: sudo is not required in windows.* + ## Install - git clone https://github.com/tmolteno/python-necpp.git - cd python-necpp - git submodule init - git submodule update --remote - cd PyNEC - ./build.sh - sudo python setup.py install + $ sudo pip install pynec + *Note: sudo is not required in windows.* ## Testing - python example/test_rp.py +Requirements - +* matplotlib + + $ python example/test_rp.py + + The example directory contains the following additional examples (that are inspired by excercises from a course on antennas): * logperiodic_opt.py is an example on how to combine PyNECPP with scipy.optimize to use a genetic algorithm to **optimize an antenna for multiple frequency bands** at the same time (which I thin is not possible in 4nec2). The resulting gains and VSWR are plotted over the frequency range of interest. This requires scipy >= 0.15.0 due to the usage of scipy.optimize.differential_evolution. diff --git a/PyNEC/build.sh b/PyNEC/build.sh index 9712711..a6566dd 100755 --- a/PyNEC/build.sh +++ b/PyNEC/build.sh @@ -5,7 +5,8 @@ # Author. Tim Molteno. # git submodule update --remote -# + +# In windows this generates error since, the make, configure,libtoolize shows ignorable error pushd ../necpp_src make -f Makefile.git ./configure --without-lapack diff --git a/PyNEC/setup.py b/PyNEC/setup.py index dd8d0bd..ccc779c 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -6,18 +6,19 @@ Author Tim Molteno. tim@molteno.net """ -from distutils.core import setup, Extension -import distutils.sysconfig +from setuptools import setup +from setuptools.extension import Extension +#import distutils.sysconfig from glob import glob import os import numpy as np - +import io # Remove silly flags from the compilation to avoid warnings. -cfg_vars = distutils.sysconfig.get_config_vars() -for key, value in cfg_vars.items(): - if type(value) == str: - cfg_vars[key] = value.replace("-Wstrict-prototypes", "") +#cfg_vars = distutils.sysconfig.get_config_vars() +#for key, value in cfg_vars.items(): +# if type(value) == str: +# cfg_vars[key] = value.replace("-Wstrict-prototypes", "") # Generate a list of the sources. nec_sources = [] @@ -32,23 +33,19 @@ nec_headers.extend(glob("../necpp_src/src/*.h")) nec_headers.extend(glob("../necpp_src/config.h")) -with open('README.txt') as f: - readme = f.read() - +readme = io.open('README.txt').read() # At the moment, the config.h file is needed, and this should be generated from the ./configure # command in the parent directory. Use ./configure --without-lapack to avoid dependance on LAPACK # necpp_module = Extension('_PyNEC', sources=nec_sources, - include_dirs=[np.get_include(), '../necpp_src/src', '../necpp_src/'], + include_dirs=[np.get_include(), '../necpp_src/src', '../necpp_src/','../necpp_src/win32/nec2++'], extra_compile_args = ['-fPIC'], extra_link_args = ['-lstdc++'], depends=nec_headers, - define_macros=[('BUILD_PYTHON', '1'), ('NPY_NO_DEPRECATED_API','NPY_1_7_API_VERSION')] - ) - - + define_macros=[('BUILD_PYTHON', '1'), ('NPY_NO_DEPRECATED_API','NPY_1_7_API_VERSION')], +) setup (name = 'PyNEC', version = '1.7.3.1', From 542495c7244b747563cff21b2ffbcf80db8c0d85 Mon Sep 17 00:00:00 2001 From: Rounak Singh Date: Tue, 5 Dec 2017 01:32:20 -0500 Subject: [PATCH 03/34] PyNEC readme updated. --- PyNEC/README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/PyNEC/README.md b/PyNEC/README.md index 837a7db..28663c5 100644 --- a/PyNEC/README.md +++ b/PyNEC/README.md @@ -52,32 +52,33 @@ Here is an example that plots a radiation pattern. plt.savefig('RadiationPattern.png') plt.show() -## Build +## Manual Build & install Requirements -* [Pandoc](https://pandoc.org/) +* [Pandoc](https://pandoc.org/) * [Swig](http://www.swig.org/) * configure & make * pip * setuptools * wheel -*Note: For Windows: Compling requires [C/C++ compliers](https://wiki.python.org/moin/WindowsCompilers). Also, add the path to swig.exe to environment.* + +*Note: For Windows: Building requires [C/C++ compliers](https://wiki.python.org/moin/WindowsCompilers). Download and extract swigwin.zip and add the path to swig.exe to environment.* $ git clone --recursive https://github.com/tmolteno/python-necpp.git $ cd python-necpp $ cd PyNEC $ ./build.sh - $ python setup.py bdist_wheel $ sudo python setup.py install - *Note: sudo is not required in windows.* + *Note: 1) For windows: sudo is not required. 2) For generating wheels, use `$ python setup.py bdist_wheel`* -## Install +## Install from PyPI $ sudo pip install pynec - *Note: sudo is not required in windows.* + + *Note: sudo is not required in windows. * ## Testing From af9d26d4682a2d7fd38381efa00beb3b95f8855b Mon Sep 17 00:00:00 2001 From: Rounak Singh Date: Tue, 5 Dec 2017 04:40:13 -0500 Subject: [PATCH 04/34] updated Readme.md. #4, #6 and #7. Build still needs a work-around see tmolteno/necpp#51 --- PyNEC/README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PyNEC/README.md b/PyNEC/README.md index 28663c5..1829c1d 100644 --- a/PyNEC/README.md +++ b/PyNEC/README.md @@ -56,39 +56,40 @@ Here is an example that plots a radiation pattern. Requirements -* [Pandoc](https://pandoc.org/) -* [Swig](http://www.swig.org/) -* configure & make -* pip -* setuptools -* wheel +* [Pandoc](https://pandoc.org/installing.html) +* [Swig](http://www.swig.org/download.html) +* For Windows: [C/C++ compilers](https://wiki.python.org/moin/WindowsCompilers). +* Git bash (for running build.sh script) +* Latest python packages: pip, setuptools, numpy, wheel, numpy. Run: +`$ pip install --upgrade pip setuptools wheel numpy` -*Note: For Windows: Building requires [C/C++ compliers](https://wiki.python.org/moin/WindowsCompilers). Download and extract swigwin.zip and add the path to swig.exe to environment.* +*Note: Download and extract swigwin.zip and add the path to swig.exe to environment.* +Then do following: $ git clone --recursive https://github.com/tmolteno/python-necpp.git $ cd python-necpp $ cd PyNEC $ ./build.sh + $ python setup.py bdist_wheel (For generating wheel, requires wheel package) $ sudo python setup.py install - *Note: 1) For windows: sudo is not required. 2) For generating wheels, use `$ python setup.py bdist_wheel`* +*Note: 'sudo' is not required in windows.* ## Install from PyPI $ sudo pip install pynec - *Note: sudo is not required in windows. * +*Note: 'sudo' is not required in windows.* ## Testing Requirements -* matplotlib +* python package: matplotlib $ python example/test_rp.py - The example directory contains the following additional examples (that are inspired by excercises from a course on antennas): * logperiodic_opt.py is an example on how to combine PyNECPP with scipy.optimize to use a genetic algorithm to **optimize an antenna for multiple frequency bands** at the same time (which I thin is not possible in 4nec2). The resulting gains and VSWR are plotted over the frequency range of interest. This requires scipy >= 0.15.0 due to the usage of scipy.optimize.differential_evolution. From 8715f378514782fc3acb8ed9bcd1215ec8363413 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 27 Apr 2018 12:54:19 +1200 Subject: [PATCH 05/34] Updated to include more source files in the source distribution --- necpp/MANIFEST.in | 8 ++++---- necpp/build.sh | 4 +++- necpp/setup.py | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/necpp/MANIFEST.in b/necpp/MANIFEST.in index 0c11346..bb7bd4c 100644 --- a/necpp/MANIFEST.in +++ b/necpp/MANIFEST.in @@ -1,7 +1,7 @@ include LICENCE.txt -include ../necpp_src/src/*.h +include necpp_src/src/*.h +include necpp_src/config.h -include ../necpp_src/config.h - -include ../necpp_src/example/test.py +include necpp_src/example/test.py +include example/*.py diff --git a/necpp/build.sh b/necpp/build.sh index 41b1359..a55abcf 100755 --- a/necpp/build.sh +++ b/necpp/build.sh @@ -1,12 +1,14 @@ #!/bin/bash # Script to build the nec2++ python module. git submodule update --remote +ln -s ../necpp_src . pushd ../necpp_src make -f Makefile.git ./configure --without-lapack popd pandoc -o README.txt README.md PYTHON=python -swig -v -I../necpp_src/src/ -python necpp.i +swig -v -Inecpp_src/src/ -python necpp.i python setup.py build +python setup.py dist #sudo python setup.py install diff --git a/necpp/setup.py b/necpp/setup.py index 8040245..9516683 100644 --- a/necpp/setup.py +++ b/necpp/setup.py @@ -9,7 +9,7 @@ import os nec_sources = [] -nec_sources.extend([fn for fn in glob('../necpp_src/src/*.cpp') +nec_sources.extend([fn for fn in glob('necpp_src/src/*.cpp') if not os.path.basename(fn).endswith('_tb.cpp') if not os.path.basename(fn).startswith('net_solve.cpp') if not os.path.basename(fn).startswith('nec2cpp.cpp') @@ -17,8 +17,8 @@ nec_sources.extend(glob("necpp_wrap.c")) nec_headers = [] -nec_headers.extend(glob("../necpp_src/src/*.h")) -nec_headers.extend(glob("../necpp_src/config.h")) +nec_headers.extend(glob("necpp_src/src/*.h")) +nec_headers.extend(glob("necpp_src/config.h")) # At the moment, the config.h file is needed, and this should be generated from the ./configure @@ -26,7 +26,7 @@ # necpp_module = Extension('_necpp', sources=nec_sources, - include_dirs=['../necpp_src/src/', '../necpp_src/'], + include_dirs=['necpp_src/src/', 'necpp_src/'], depends=nec_headers, define_macros=[('BUILD_PYTHON', '1')] ) @@ -35,7 +35,7 @@ readme = f.read() setup (name = 'necpp', - version = '1.7.3.2', + version = '1.7.3.3', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", url = "http://github.com/tmolteno/necpp", From b5bf591bccf88748fc05dfcf53aa74b69298b691 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 27 Apr 2018 14:39:44 +1200 Subject: [PATCH 06/34] Added improved source handling - the sources werent being included in the sdist --- PyNEC/MANIFEST.in | 4 ++-- PyNEC/build.sh | 5 +++-- PyNEC/setup.py | 10 +++++----- README.md | 3 ++- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/PyNEC/MANIFEST.in b/PyNEC/MANIFEST.in index 5b3d3ed..181a486 100644 --- a/PyNEC/MANIFEST.in +++ b/PyNEC/MANIFEST.in @@ -1,8 +1,8 @@ include LICENCE.txt -include ../necpp_src/src/*.h +include necpp_src/src/*.h -include ../necpp_src/config.h +include necpp_src/config.h include example/*.py diff --git a/PyNEC/build.sh b/PyNEC/build.sh index 9712711..dfaed9e 100755 --- a/PyNEC/build.sh +++ b/PyNEC/build.sh @@ -6,7 +6,8 @@ # git submodule update --remote # -pushd ../necpp_src +ln -s ../necpp_src . +pushd necpp_src make -f Makefile.git ./configure --without-lapack popd @@ -16,4 +17,4 @@ pandoc -o README.txt README.md # Build PyNEC swig -Wall -v -c++ -python PyNEC.i -python setup.py build \ No newline at end of file +python setup.py build diff --git a/PyNEC/setup.py b/PyNEC/setup.py index dd8d0bd..8ce5771 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -21,7 +21,7 @@ # Generate a list of the sources. nec_sources = [] -nec_sources.extend([fn for fn in glob('../necpp_src/src/*.cpp') +nec_sources.extend([fn for fn in glob('necpp_src/src/*.cpp') if not os.path.basename(fn).endswith('_tb.cpp') if not os.path.basename(fn).startswith('net_solve.cpp') if not os.path.basename(fn).startswith('nec2cpp.cpp') @@ -29,8 +29,8 @@ nec_sources.extend(glob("PyNEC_wrap.cxx")) nec_headers = [] -nec_headers.extend(glob("../necpp_src/src/*.h")) -nec_headers.extend(glob("../necpp_src/config.h")) +nec_headers.extend(glob("necpp_src/src/*.h")) +nec_headers.extend(glob("necpp_src/config.h")) with open('README.txt') as f: readme = f.read() @@ -41,7 +41,7 @@ # necpp_module = Extension('_PyNEC', sources=nec_sources, - include_dirs=[np.get_include(), '../necpp_src/src', '../necpp_src/'], + include_dirs=[np.get_include(), 'necpp_src/src', 'necpp_src/'], extra_compile_args = ['-fPIC'], extra_link_args = ['-lstdc++'], depends=nec_headers, @@ -51,7 +51,7 @@ setup (name = 'PyNEC', - version = '1.7.3.1', + version = '1.7.3.3', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", url = "http://github.com/tmolteno/necpp", diff --git a/README.md b/README.md index 3b597f1..9e20312 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # python-necpp: Antenna simulation in python -This repository contains two wrappers for the nec2++ antenna simulation package: +This repository contains two wrappers for the [http://github.com/tmolteno/necpp nec2++] antenna simulation package: * necpp/ contains a wrapper using SWIG of the C interface (Python module name: necpp). * PyNEC/ contains a wrapper of the C++ interfaces (Python module name: PyNEC). The example/ directory furthermore contains some nicer, more readable Python wrappers that make toying around with NEC a less painful experience. @@ -8,4 +8,5 @@ This repository contains two wrappers for the nec2++ antenna simulation package: Both are based on Tim Molteno (tim@physics.otago.ac.nz)'s code with major cleanup by Bart Coppens. ## TODOs + The cleaner API should really be **ported to C++**, so the clean wrappers get automatically generated, and C++ can use the same cleaner interface. But for now, I'm happy with the Python wrapper :) From 30158674311b3c2ddb6872196954f7e075e1866f Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 3 May 2018 16:23:27 +1200 Subject: [PATCH 07/34] Added an example that uses a different material --- necpp/example/different_material.py | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 necpp/example/different_material.py diff --git a/necpp/example/different_material.py b/necpp/example/different_material.py new file mode 100644 index 0000000..92b87c1 --- /dev/null +++ b/necpp/example/different_material.py @@ -0,0 +1,50 @@ +from necpp import * +import math + +def handle_nec(result): + if (result != 0): + print(nec_error_message()) + +def geometry(freq, base, length): + + conductivity = 1.45e6 # Stainless steel + ground_conductivity = 0.002 + ground_dielectric = 10 + + wavelength = 3e8/(1e6*freq) + n_seg = int(math.ceil(50*length/wavelength)) + nec = nec_create() + + ''' + \brief Set the prameters of the medium (permittivity and permeability) + + \param permittivity The electric permittivity of the medium (in farads per meter) + \param permeability The magnetic permeability of the medium (in henries per meter) + + \remark From these parameters a speed of light is chosen. + ''' + permittivity = 8.8e-12 # Farads per meter + permeability = 4*math.pi*1e-7 + handle_nec(nec_medium_parameters(nec, 2.0*permittivity, permeability)) + + handle_nec(nec_wire(nec, 1, n_seg, 0, 0, base, 0, 0, base+length, 0.002, 1.0, 1.0)) + handle_nec(nec_geometry_complete(nec, 1)) + handle_nec(nec_ld_card(nec, 5, 0, 0, 0, conductivity, 0.0, 0.0)) + handle_nec(nec_gn_card(nec, 0, 0, ground_dielectric, ground_conductivity, 0, 0, 0, 0)) + handle_nec(nec_fr_card(nec, 0, 1, freq, 0)) + # Voltage excitation one third of the way along the wire + handle_nec(nec_ex_card(nec, 0, 0, int(n_seg/3), 0, 1.0, 0, 0, 0, 0, 0)) + + return nec + +def impedance(freq, base, length): + nec = geometry(freq, base, length) + handle_nec(nec_xq_card(nec, 0)) # Execute simulation + index = 0 + z = complex(nec_impedance_real(nec,index), nec_impedance_imag(nec,index)) + nec_delete(nec) + return z + +if (__name__ == '__main__'): + z = impedance(freq = 134.5, base = 0.5, length = 4.0) + print("Impedance at base=%0.2f, length=%0.2f : (%6.1f,%+6.1fI) Ohms" % (0.5, 4.0, z.real, z.imag)) From ccfefc5d3589d25e8046ac7d5bad47bf2a4d45d9 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 01:18:57 +1200 Subject: [PATCH 08/34] Update setuptools. Add install instructions --- PyNEC/INSTALL.md | 17 +++++++++++++++++ PyNEC/{LICENSE.txt => LICENCE.txt} | 0 PyNEC/build.sh | 13 ++++++------- PyNEC/setup.py | 22 ++++++++++++---------- 4 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 PyNEC/INSTALL.md rename PyNEC/{LICENSE.txt => LICENCE.txt} (100%) diff --git a/PyNEC/INSTALL.md b/PyNEC/INSTALL.md new file mode 100644 index 0000000..06059a3 --- /dev/null +++ b/PyNEC/INSTALL.md @@ -0,0 +1,17 @@ +## Building from Source + + aptitude install swig3.0 + git submodule init + git submodule update --remote + cd PyNEC + ./build.sh + sudo python setup.py install + + +## Uploading the package to pypi + +Source & Binary Distribution + python3 setup.py sdist + python3 setup.py bdist_wheel + + python3 setup.py upload diff --git a/PyNEC/LICENSE.txt b/PyNEC/LICENCE.txt similarity index 100% rename from PyNEC/LICENSE.txt rename to PyNEC/LICENCE.txt diff --git a/PyNEC/build.sh b/PyNEC/build.sh index dfaed9e..6ec0a01 100755 --- a/PyNEC/build.sh +++ b/PyNEC/build.sh @@ -4,17 +4,16 @@ # # Author. Tim Molteno. # +# FIrst have to do git submodule init git submodule update --remote # ln -s ../necpp_src . -pushd necpp_src +DIR=`pwd` +cd necpp_src make -f Makefile.git ./configure --without-lapack -popd - -# Generate a README.txt from README.md -pandoc -o README.txt README.md +cd ${DIR} # Build PyNEC -swig -Wall -v -c++ -python PyNEC.i -python setup.py build +swig3.0 -Wall -v -c++ -python PyNEC.i +python3 setup.py build diff --git a/PyNEC/setup.py b/PyNEC/setup.py index 8ce5771..0251cf8 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -6,12 +6,11 @@ Author Tim Molteno. tim@molteno.net """ -from distutils.core import setup, Extension import distutils.sysconfig from glob import glob import os import numpy as np - +import setuptools # Remove silly flags from the compilation to avoid warnings. cfg_vars = distutils.sysconfig.get_config_vars() @@ -32,14 +31,14 @@ nec_headers.extend(glob("necpp_src/src/*.h")) nec_headers.extend(glob("necpp_src/config.h")) -with open('README.txt') as f: - readme = f.read() +#with open('README.txt') as f: + #readme = f.read() # At the moment, the config.h file is needed, and this should be generated from the ./configure # command in the parent directory. Use ./configure --without-lapack to avoid dependance on LAPACK # -necpp_module = Extension('_PyNEC', +necpp_module = setuptools.Extension('_PyNEC', sources=nec_sources, include_dirs=[np.get_include(), 'necpp_src/src', 'necpp_src/'], extra_compile_args = ['-fPIC'], @@ -48,16 +47,19 @@ define_macros=[('BUILD_PYTHON', '1'), ('NPY_NO_DEPRECATED_API','NPY_1_7_API_VERSION')] ) - - -setup (name = 'PyNEC', - version = '1.7.3.3', +with open("README.md", "r") as fh: + long_description = fh.read() + +setuptools.setup (name = 'PyNEC', + version = '1.7.3.4', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", url = "http://github.com/tmolteno/necpp", keywords = "nec2 nec2++ antenna electromagnetism radio", description = "Python Antenna Simulation Module (nec2++) object-oriented interface", - long_description=readme, + long_description=long_description, + long_description_content_type="text/markdown", + include_package_data=True, data_files=[('examples', ['example/test_rp.py'])], ext_modules = [necpp_module], requires = ['numpy'], From 195d8be6ce1933e8b633f9e0d6dac478fcd321fb Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 01:35:08 +1200 Subject: [PATCH 09/34] Updated to 1.7.3.4. Fixed missing source files --- PyNEC/Makefile | 18 ++++++++++++++++++ PyNEC/setup.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 PyNEC/Makefile diff --git a/PyNEC/Makefile b/PyNEC/Makefile new file mode 100644 index 0000000..65b7125 --- /dev/null +++ b/PyNEC/Makefile @@ -0,0 +1,18 @@ +build: + python3 setup.py sdist + #python3 setup.py bdist_wheel + +clean: + rm -rf build + rm -rf dist + +test-upload: + python3 -m pip install --user --upgrade twine + + python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* + +upload: + python3 -m twine upload dist/* + +test: + python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps PyNEC diff --git a/PyNEC/setup.py b/PyNEC/setup.py index 0251cf8..a8d669e 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -54,7 +54,7 @@ version = '1.7.3.4', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", - url = "http://github.com/tmolteno/necpp", + url = "http://github.com/tmolteno/python-necpp", keywords = "nec2 nec2++ antenna electromagnetism radio", description = "Python Antenna Simulation Module (nec2++) object-oriented interface", long_description=long_description, From 9fefaa873c1a0e09f93a77bf19a8000c87660cd6 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 01:54:11 +1200 Subject: [PATCH 10/34] Version bump to 1.7.3.5. Upgrade setup to latest version. --- necpp/{LICENSE.txt => LICENCE.txt} | 0 necpp/Makefile | 20 ++++++++++++++++++++ necpp/build.sh | 13 ++++++------- necpp/setup.py | 10 ++++++---- 4 files changed, 32 insertions(+), 11 deletions(-) rename necpp/{LICENSE.txt => LICENCE.txt} (100%) create mode 100644 necpp/Makefile diff --git a/necpp/LICENSE.txt b/necpp/LICENCE.txt similarity index 100% rename from necpp/LICENSE.txt rename to necpp/LICENCE.txt diff --git a/necpp/Makefile b/necpp/Makefile new file mode 100644 index 0000000..9f1f3e5 --- /dev/null +++ b/necpp/Makefile @@ -0,0 +1,20 @@ +build: + sh build.sh + python3 setup.py sdist + #python3 setup.py bdist_wheel + +clean: + rm -rf necpp_src + rm -rf build + rm -rf dist + +test-upload: + python3 -m pip install --user --upgrade twine + + python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* + +upload: + python3 -m twine upload dist/* + +test-install: + python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps necpp --upgrade diff --git a/necpp/build.sh b/necpp/build.sh index a55abcf..a99d63b 100755 --- a/necpp/build.sh +++ b/necpp/build.sh @@ -2,13 +2,12 @@ # Script to build the nec2++ python module. git submodule update --remote ln -s ../necpp_src . -pushd ../necpp_src +DIR=`pwd` +cd necpp_src make -f Makefile.git ./configure --without-lapack -popd -pandoc -o README.txt README.md -PYTHON=python -swig -v -Inecpp_src/src/ -python necpp.i -python setup.py build -python setup.py dist +cd ${DIR} +PYTHON=python3 +swig3.0 -v -Inecpp_src/src/ -python necpp.i +python3 setup.py build #sudo python setup.py install diff --git a/necpp/setup.py b/necpp/setup.py index 9516683..f410e43 100644 --- a/necpp/setup.py +++ b/necpp/setup.py @@ -4,7 +4,7 @@ setup.py file for necpp Python module. """ -from distutils.core import setup, Extension +from setuptools import setup, Extension from glob import glob import os @@ -31,18 +31,20 @@ define_macros=[('BUILD_PYTHON', '1')] ) -with open('README.txt') as f: +with open('README.md') as f: readme = f.read() setup (name = 'necpp', - version = '1.7.3.3', + version = '1.7.3.5', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", url = "http://github.com/tmolteno/necpp", keywords = "nec2 nec2++ antenna electromagnetism radio", description = "Python Antenna Simulation Module (nec2++) C-style interface", long_description=readme, - data_files=[('examples', ['../necpp_src/example/test.py'])], + long_description_content_type="text/markdown", + include_package_data=True, + data_files=[('examples', ['necpp_src/example/test.py'])], ext_modules = [necpp_module], py_modules = ["necpp"], license='GPLv2', From c40fa0668d20e42304e2015baa6455b2a44e24f3 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 02:36:39 +1200 Subject: [PATCH 11/34] Update test_get_gain to use PyNEC format --- PyNEC/tests/Makefile | 2 +- PyNEC/tests/test_get_gain.py | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/PyNEC/tests/Makefile b/PyNEC/tests/Makefile index b67626b..a3792fa 100644 --- a/PyNEC/tests/Makefile +++ b/PyNEC/tests/Makefile @@ -1,2 +1,2 @@ test: - python -m unittest discover + python3 -m unittest discover diff --git a/PyNEC/tests/test_get_gain.py b/PyNEC/tests/test_get_gain.py index dd1a4a1..054e940 100644 --- a/PyNEC/tests/test_get_gain.py +++ b/PyNEC/tests/test_get_gain.py @@ -1,4 +1,4 @@ -from PyNEC import * +import PyNEC import unittest @@ -22,15 +22,18 @@ def test_example4(self): RP 0 10 4 1001 0. 0. 10. 30. EN ''' - nec = nec_create() - nec.sp_card(0, 0.1, 0.05, 0.05, 0.0, 0.0, 0.01) - nec.sp_card(0, .05, .1, .05, 0.0, 90.0, 0.01) - nec.gx_card(0, 110) - nec.sp_card(0, 0.0, 0.0, 0.1, 90.0, 0.0, 0.04) + nec= PyNEC.nec_context() + + geo = nec.get_geometry() + + geo.sp_card(0, 0.1, 0.05, 0.05, 0.0, 0.0, 0.01) + geo.sp_card(0, .05, .1, .05, 0.0, 90.0, 0.01) + geo.gx_card(0, 110) + geo.sp_card(0, 0.0, 0.0, 0.1, 90.0, 0.0, 0.04) - nec.wire(1, 4, 0., 0.0, 0.1, 0.0, 0.0, 0.3, .001, 1.0, 1.0) - nec.wire(2, 2, 0., 0.0, 0.3, 0.15, 0.0, 0.3, .001, 1.0, 1.0) - nec.wire(3, 2, 0., 0.0, 0.3, -.15, 0.0, 0.3, .001, 1.0, 1.0) + geo.wire(1, 4, 0., 0.0, 0.1, 0.0, 0.0, 0.3, .001, 1.0, 1.0) + geo.wire(2, 2, 0., 0.0, 0.3, 0.15, 0.0, 0.3, .001, 1.0, 1.0) + geo.wire(3, 2, 0., 0.0, 0.3, -.15, 0.0, 0.3, .001, 1.0, 1.0) nec.geometry_complete(1) nec.gn_card(1, 0, 0, 0, 0, 0, 0, 0) @@ -38,18 +41,16 @@ def test_example4(self): nec.ex_card(0, 1, 1, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) nec.rp_card(0,10,4,1,0,0,1,0.0,0.0,10.0,30.0, 0, 0) - self.assertAlmostEqual(nec_gain_max(nec,0),5.076,3) + self.assertAlmostEqual(nec.get_gain_max(0),5.076,3) gmax = -999.0 for theta_index in range(0,10): for phi_index in range(0,4): - g = nec_gain(nec,0,theta_index, phi_index) + g = nec.get_gain(0,theta_index, phi_index) gmax = max(g, gmax) - self.assertAlmostEqual(gmax, nec_gain_max(nec,0), 5 ) - - nec_delete(nec) + self.assertAlmostEqual(gmax, nec.get_gain_max(0), 5 ) if __name__ == '__main__': From 800ee85c454cca5501858d5c729f155125fc97b0 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 02:37:09 +1200 Subject: [PATCH 12/34] Update target names --- PyNEC/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyNEC/Makefile b/PyNEC/Makefile index 65b7125..013b78f 100644 --- a/PyNEC/Makefile +++ b/PyNEC/Makefile @@ -14,5 +14,5 @@ test-upload: upload: python3 -m twine upload dist/* -test: - python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps PyNEC +test-install: + python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps PyNEC --upgrade From abe12ad70f815c1b60ace001a072f60767c47a71 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 02:37:38 +1200 Subject: [PATCH 13/34] Fix typo from manual merge --- PyNEC/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyNEC/build.sh b/PyNEC/build.sh index 026b639..728e305 100755 --- a/PyNEC/build.sh +++ b/PyNEC/build.sh @@ -8,7 +8,7 @@ git submodule update --remote ln -s ../necpp_src . DIR=`pwd` -cd necpp_src +cd ../necpp_src make -f Makefile.git ./configure --without-lapack cd ${DIR} From 296e68ebf38b600ebf65baeb0283d7a8316cf66b Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 02:38:24 +1200 Subject: [PATCH 14/34] Add new methods to get gain statistics to the nec_context SWIG wrapper. --- PyNEC/example/monopole.py | 2 +- PyNEC/interface_files/nec_context.i | 32 +++++++++++++++++++++++++++++ PyNEC/setup.py | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/PyNEC/example/monopole.py b/PyNEC/example/monopole.py index 9cf166d..3c881a8 100644 --- a/PyNEC/example/monopole.py +++ b/PyNEC/example/monopole.py @@ -1,6 +1,6 @@ # # Simple vertical monopole antenna simulation using python-necpp -# pip install necpp +# pip install PyNEC # from PyNEC import * diff --git a/PyNEC/interface_files/nec_context.i b/PyNEC/interface_files/nec_context.i index bd1fb23..a010769 100644 --- a/PyNEC/interface_files/nec_context.i +++ b/PyNEC/interface_files/nec_context.i @@ -12,7 +12,39 @@ public: c_geometry* get_geometry(); + /*! \brief Get the maximum gain in dB. + This function requires a previous rp_card() method to have been called (with gain normalization requested) + + \return The maximum gain in dB or -999.0 if no radiation pattern had been previously requested. + */ + double get_gain(int freq_index, int theta_index, int phi_index); + + double get_gain_max(int freq_index); + double get_gain_min(int freq_index); + double get_gain_mean(int freq_index); + double get_gain_sd(int freq_index); + + /********************** RHCP ********************************/ + double get_gain_rhcp_max(int freq_index); + double get_gain_rhcp_min(int freq_index); + double get_gain_rhcp_mean(int freq_index); + double get_gain_rhcp_sd(int freq_index); + + /********************** LHCP ********************************/ + double get_gain_lhcp_max(int freq_index); + double get_gain_lhcp_min(int freq_index); + double get_gain_lhcp_mean(int freq_index); + double get_gain_lhcp_sd(int freq_index); + + /****************** IMPEDANCE CHARACTERISTICS *********************/ + + /*! \brief Impedance: Real Part */ + double get_impedance_real(int freq_index); + /*! \brief Impedance: Imaginary Part */ + double get_impedance_imag(int freq_index); + + /*! Get the result antenna_input_parameters specified by index \param index The index of the requested result. diff --git a/PyNEC/setup.py b/PyNEC/setup.py index 531304f..5306c6c 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -49,7 +49,7 @@ long_description = fh.read() setuptools.setup (name = 'PyNEC', - version = '1.7.3.4', + version = '1.7.3.5', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", url = "http://github.com/tmolteno/python-necpp", From 4607f49e20fd046c3b3947c816737c200fad9b21 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 02:42:10 +1200 Subject: [PATCH 15/34] Update gitignore files --- PyNEC/.gitignore | 3 ++- necpp/.gitignore | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 necpp/.gitignore diff --git a/PyNEC/.gitignore b/PyNEC/.gitignore index f0766ac..fbe747b 100644 --- a/PyNEC/.gitignore +++ b/PyNEC/.gitignore @@ -2,4 +2,5 @@ build/** *.pyc PyNEC.py *.cxx -*.png \ No newline at end of file +*.png +necpp_src diff --git a/necpp/.gitignore b/necpp/.gitignore new file mode 100644 index 0000000..d66c9ee --- /dev/null +++ b/necpp/.gitignore @@ -0,0 +1,3 @@ +necpp_wrap.c +necpp_src +necpp.py From 49936e72827a186302305adab158a04b5912f1fe Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Fri, 30 Aug 2019 03:50:24 +1200 Subject: [PATCH 16/34] Added Makefile to build wheels in the root directory --- Makefile | 9 +++++++++ PyNEC/Makefile | 1 + build_wheels.sh | 22 ++++++++++++++++++++++ dev-requirements.txt | 1 + 4 files changed, 33 insertions(+) create mode 100644 Makefile create mode 100755 build_wheels.sh create mode 100644 dev-requirements.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7442de6 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +PLAT=manylinux1_x86_64 +DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 +PRE_CMD= +docker-wheels: + docker run --rm -e PLAT=${PLAT} -v `pwd`:/io ${DOCKER_IMAGE} ${PRE_CMD} /io/build_wheels.sh + auditwheel repair /output/mylibrary*whl -w /output + +install: + docker pull ${DOCKER_IMAGE} diff --git a/PyNEC/Makefile b/PyNEC/Makefile index 013b78f..8b45947 100644 --- a/PyNEC/Makefile +++ b/PyNEC/Makefile @@ -16,3 +16,4 @@ upload: test-install: python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps PyNEC --upgrade + diff --git a/build_wheels.sh b/build_wheels.sh new file mode 100755 index 0000000..d19092b --- /dev/null +++ b/build_wheels.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e -x + +# Install a system package required by our library +# yum install -y atlas-devel + +# Compile wheels +for PYBIN in /opt/python/*/bin; do + "${PYBIN}/pip" install -r /io/dev-requirements.txt + "${PYBIN}/pip" wheel -e /io/PyNEC/ -w wheelhouse/ +done + +# Bundle external shared libraries into the wheels +for whl in wheelhouse/*.whl; do + auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/ +done + +# Install packages and test +for PYBIN in /opt/python/*/bin/; do + "${PYBIN}/pip" install PyNEC --no-index -f /io/wheelhouse + (cd "$HOME"; "${PYBIN}/nosetests" pymanylinuxdemo) +done diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000..24ce15a --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1 @@ +numpy From 0dab594d4fc6a02743ff3790195a9fb0d75dcc23 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 30 Aug 2019 11:51:44 +1200 Subject: [PATCH 17/34] Converted to python3. Added options to optimization --- PyNEC/example/README.md | 14 +++++ PyNEC/example/context_clean.py | 2 +- PyNEC/example/dipole.py | 14 ++--- PyNEC/example/logperiodic_opt.py | 16 ++--- PyNEC/example/monopole.py | 46 +++++++------- .../monopole_realistic_ground_plane.py | 18 +++--- PyNEC/example/optimized.py | 62 ++++++++++++++----- PyNEC/example/radiation_pattern.py | 8 +-- PyNEC/example/test_ne_nh.py | 2 +- 9 files changed, 113 insertions(+), 69 deletions(-) create mode 100644 PyNEC/example/README.md diff --git a/PyNEC/example/README.md b/PyNEC/example/README.md new file mode 100644 index 0000000..6989ece --- /dev/null +++ b/PyNEC/example/README.md @@ -0,0 +1,14 @@ +# PyNEC examples + +This folder contains some examples showing the use of PyNEC antenna simulation module + +## Optimizing a Monopole + +The file monopole.py simulates a monopole antenna, printing out the impedance. To optimize this + + python3 monopole.py + +To optimize the monopole design to achieve a particular impedance, try + + python3 optimized.py --basinhopping --target-impedance=110 + diff --git a/PyNEC/example/context_clean.py b/PyNEC/example/context_clean.py index 0242073..9caaebd 100644 --- a/PyNEC/example/context_clean.py +++ b/PyNEC/example/context_clean.py @@ -19,7 +19,7 @@ def __init__(self, start, stop, count=None, delta=None): def debug(card, *args): if do_debug: stringified = " , ".join([str(a) for a in args]) - print "%s %s" % (card, stringified) + print("%s %s" % (card, stringified)) class context_clean(object): def __init__(self, context): diff --git a/PyNEC/example/dipole.py b/PyNEC/example/dipole.py index abe1c26..780c713 100644 --- a/PyNEC/example/dipole.py +++ b/PyNEC/example/dipole.py @@ -89,13 +89,13 @@ def matched_range_around(nec, count, center_freq, system_impedance): initial_length = wavelength / 2 # TODO - print "Wavelength is %0.4fm, initial length is %0.4fm" % (wavelength, initial_length) + print("Wavelength is %0.4fm, initial length is %0.4fm" % (wavelength, initial_length)) nr_segments = 101 # int(math.ceil(50*initial_length/wavelength)) z = impedance(design_freq_mhz, initial_length, nr_segments) - print "Initial impedance: (%6.1f,%+6.1fI) Ohms" % (z.real, z.imag) + print("Initial impedance: (%6.1f,%+6.1fI) Ohms" % (z.real, z.imag)) target = create_optimization_target(design_freq_mhz, nr_segments) optimized_result = scipy.optimize.minimize(target, np.array([initial_length])) @@ -103,8 +103,8 @@ def matched_range_around(nec, count, center_freq, system_impedance): z = impedance(design_freq_mhz, optimized_length, nr_segments) - print "Optimized length %6.6f m, which gives an impedance of: (%6.4f,%+6.4fI) Ohms" % (optimized_length, z.real, z.imag) - print "VSWR @ 75 Ohm is %6.6f" % vswr(z, 75) + print("Optimized length %6.6f m, which gives an impedance of: (%6.4f,%+6.4fI) Ohms" % (optimized_length, z.real, z.imag)) + print("VSWR @ 75 Ohm is %6.6f" % vswr(z, 75)) for system_impedance in [75, 50, 300]: nec = geometry(design_freq_mhz, optimized_length, nr_segments) @@ -117,10 +117,10 @@ def matched_range_around(nec, count, center_freq, system_impedance): rng = matched_range_around(nec, count, design_freq_mhz, system_impedance) if rng[0] is None or rng[1] is None: - print "VSWR is nowhere <= 2 @ %i Ohm!" % system_impedance + print("VSWR is nowhere <= 2 @ %i Ohm!" % system_impedance) else: bandwidth = 100.0 * (rng[1] - rng[0]) / design_freq_mhz - print "The fractional bandwidth @ %i Ohm is %2.2f%% - %i MHz (%i Mhz to %i MHz)" % (system_impedance, bandwidth, (rng[1] - rng[0]), rng[0], rng[1]) + print("The fractional bandwidth @ %i Ohm is %2.2f%% - %i MHz (%i Mhz to %i MHz)" % (system_impedance, bandwidth, (rng[1] - rng[0]), rng[0], rng[1])) freqs = [] vswrs = [] @@ -140,5 +140,5 @@ def matched_range_around(nec, count, center_freq, system_impedance): plt.ylabel("VSWR") plt.grid(True) filename = "vswr_%i_MHz.pdf" % system_impedance - print "Saving plot to file: %s" % filename + print("Saving plot to file: %s" % filename) plt.savefig(filename) diff --git a/PyNEC/example/logperiodic_opt.py b/PyNEC/example/logperiodic_opt.py index 5c54d67..b9617df 100644 --- a/PyNEC/example/logperiodic_opt.py +++ b/PyNEC/example/logperiodic_opt.py @@ -129,10 +129,10 @@ def target(args): result = vswr_score - gains_score except: - print "Caught exception" + print("Caught exception") return float('inf') - print result + print(result) return result return target @@ -169,8 +169,8 @@ def show_report(l1, x1, tau): z = simulate_and_get_impedance(nec) - print "Initial impedance: (%6.1f,%+6.1fI) Ohms" % (z.real, z.imag) - print "VSWR @ 50 Ohm is %6.6f" % vswr(z, 50) + print("Initial impedance: (%6.1f,%+6.1fI) Ohms" % (z.real, z.imag)) + print("VSWR @ 50 Ohm is %6.6f" % vswr(z, 50)) nec = geometry_logperiodic(l1, x1, tau) @@ -219,12 +219,12 @@ def show_report(l1, x1, tau): initial_x1 = wavelength / 2 initial_tau = 0.8 - print "Wavelength is %0.4fm, initial length is %0.4fm" % (wavelength, initial_l1) + print("Wavelength is %0.4fm, initial length is %0.4fm" % (wavelength, initial_l1)) - print "Unoptimized antenna..." + print("Unoptimized antenna...") show_report(initial_l1, initial_x1, initial_tau) - print "Optimizing antenna..." + print("Optimizing antenna...") target = create_optimization_target() # Optimize local minimum only with gradient desce @@ -238,7 +238,7 @@ def show_report(l1, x1, tau): # Basin hopping isn't so good, but could also have been an option: #optimized_result = scipy.optimize.basinhopping(target, np.array([initial_l1, initial_x1, initial_tau]), minimizer_kwargs=minimizer_kwargs, niter=5, stepsize=0.015, T=2.0, disp=True) - print "Optimized antenna..." + print("Optimized antenna...") optimized_l1, optimized_x1, optimized_tau = optimized_result.x[0], optimized_result.x[1], optimized_result.x[2] show_report(optimized_l1, optimized_x1, optimized_tau) diff --git a/PyNEC/example/monopole.py b/PyNEC/example/monopole.py index 3c881a8..cc0eb4b 100644 --- a/PyNEC/example/monopole.py +++ b/PyNEC/example/monopole.py @@ -9,40 +9,40 @@ import math def geometry(freq, base, length): - conductivity = 1.45e6 # Stainless steel - ground_conductivity = 0.002 - ground_dielectric = 10 + conductivity = 1.45e6 # Stainless steel + ground_conductivity = 0.002 + ground_dielectric = 10 - wavelength = 3e8/(1e6*freq) - n_seg = int(math.ceil(50*length/wavelength)) + wavelength = 3e8/(1e6*freq) + n_seg = int(math.ceil(50*length/wavelength)) - nec = context_clean(nec_context()) + nec = context_clean(nec_context()) - geo = nec.get_geometry() - geo.wire(1, n_seg, 0, 0, base, 0, 0, base+length, 0.002, 1.0, 1.0) - nec.geometry_complete(1) + geo = nec.get_geometry() + geo.wire(1, n_seg, 0, 0, base, 0, 0, base+length, 0.002, 1.0, 1.0) + nec.geometry_complete(1) - nec.set_all_wires_conductivity(conductivity) + nec.set_all_wires_conductivity(conductivity) - nec.set_finite_ground(ground_dielectric, ground_conductivity) - nec.set_frequency(freq) + nec.set_finite_ground(ground_dielectric, ground_conductivity) + nec.set_frequency(freq) - # Voltage excitation one third of the way along the wire - nec.voltage_excitation(wire_tag=1, segment_nr=int(n_seg/3), voltage=1.0) + # Voltage excitation one third of the way along the wire + nec.voltage_excitation(wire_tag=1, segment_nr=int(n_seg/3), voltage=1.0) - return nec + return nec def impedance(freq, base, length): - nec = geometry(freq, base, length) - nec.xq_card(0) # Execute simulation + nec = geometry(freq, base, length) + nec.xq_card(0) # Execute simulation - index = 0 + index = 0 - ipt = nec.get_input_parameters(index) - z = ipt.get_impedance() + ipt = nec.get_input_parameters(index) + z = ipt.get_impedance() - return z + return z if (__name__ == '__main__'): - z = impedance(freq = 134.5, base = 0.5, length = 4.0) - print "Impedance at base=%0.2f, length=%0.2f : (%6.1f,%+6.1fI) Ohms" % (0.5, 4.0, z.real, z.imag) + z = impedance(freq = 134.5, base = 0.5, length = 4.0) + print("Impedance at base=%0.2f, length=%0.2f : (%6.1f,%+6.1fI) Ohms" % (0.5, 4.0, z.real, z.imag)) diff --git a/PyNEC/example/monopole_realistic_ground_plane.py b/PyNEC/example/monopole_realistic_ground_plane.py index 2d41099..8c18713 100644 --- a/PyNEC/example/monopole_realistic_ground_plane.py +++ b/PyNEC/example/monopole_realistic_ground_plane.py @@ -92,7 +92,7 @@ def target(args): nec.xq_card(0) # Execute simulation except: - print "Caught exception" + print("Caught exception") return float('inf') for idx in range(0, count): @@ -122,7 +122,7 @@ def target(args): sampled_ground_wire_lenths.append(ground_wire_length) sampled_results.append(result) - print result + print(result) return result return target @@ -133,7 +133,7 @@ def target(args): initial_length = wavelength / 4 # quarter-wavelength monopole - print "Wavelength is %0.4fm, initial length is %0.4fm" % (wavelength, initial_length) + print("Wavelength is %0.4fm, initial length is %0.4fm" % (wavelength, initial_length)) nr_segments = 15 # int(math.ceil(50*initial_length/wavelength)) #print nr_segments @@ -141,8 +141,8 @@ def target(args): ground_wire_length = 0.02 z = simulate_and_get_impedance(geometry_monopole_ground(design_freq_mhz, initial_length, ground_wire_length, nr_segments)) - print "Initial impedance: (%6.1f,%+6.1fI) Ohms" % (z.real, z.imag) - print "VSWR @ 50 Ohm is %6.6f" % vswr(z, 50) + print("Initial impedance: (%6.1f,%+6.1fI) Ohms" % (z.real, z.imag)) + print("VSWR @ 50 Ohm is %6.6f" % vswr(z, 50)) target = create_optimization_target(design_freq_mhz, nr_segments) optimized_result = scipy.optimize.minimize(target, np.array([initial_length, ground_wire_length]), method='Nelder-Mead') @@ -152,9 +152,9 @@ def target(args): geo_opt = geometry_monopole_ground(design_freq_mhz, optimized_length, optimized_ground_wire_length, nr_segments) z = simulate_and_get_impedance(geo_opt) - print "Optimized length %6.6f m and ground screen radials of length %6.6f m, which gives an impedance of: (%6.4f,%+6.4fI) Ohms" % (optimized_length, optimized_ground_wire_length, z.real, z.imag) - print "Mismatch @ 50 Ohm is %6.6f" % mismatch(z, 50) - print "VSWR @ 50 Ohm is %6.6f" % vswr(z, 50) + print("Optimized length %6.6f m and ground screen radials of length %6.6f m, which gives an impedance of: (%6.4f,%+6.4fI) Ohms" % (optimized_length, optimized_ground_wire_length, z.real, z.imag)) + print("Mismatch @ 50 Ohm is %6.6f" % mismatch(z, 50)) + print("VSWR @ 50 Ohm is %6.6f" % vswr(z, 50)) geo_opt = geometry_monopole_ground(design_freq_mhz, optimized_length, optimized_ground_wire_length, nr_segments) geo_opt.set_frequency(design_freq_mhz) @@ -172,7 +172,7 @@ def target(args): max_gain = gains_db[max_idx] max_theta = thetas[max_idx] #print gains_db - print "Maximal gain is %2.2f dBi, at an angle of %2.2f" % (max_gain, max_theta * 180.0 / np.pi) + print("Maximal gain is %2.2f dBi, at an angle of %2.2f" % (max_gain, max_theta * 180.0 / np.pi)) # Plot stuff diff --git a/PyNEC/example/optimized.py b/PyNEC/example/optimized.py index 96317eb..3d8d33f 100644 --- a/PyNEC/example/optimized.py +++ b/PyNEC/example/optimized.py @@ -1,9 +1,11 @@ # # Automatically tune antenna # -import monopole +import argparse import scipy.optimize import numpy as np + +import monopole from antenna_util import reflection_coefficient # A function that will be minimized when the impedance is 50 Ohms @@ -11,21 +13,49 @@ # numbers using exp. because otherwise the antenna will lie # below ground and cause an error in simulation. def target(x): - global freq - base_height = np.exp(x[0]) # Make it positive - length = np.exp(x[1]) # Make it positive - z = monopole.impedance(freq, base_height, length) - return reflection_coefficient(z, z0=50.0) - + global freq, target_impedance + base_height = np.exp(x[0]) # Make it positive + length = np.exp(x[1]) # Make it positive + if (length > 10.0): + return 100 + try: + z = monopole.impedance(freq, base_height, length) + return reflection_coefficient(z, z0=target_impedance) + except RuntimeError as re: + return 100 + +def print_result(x, f, accepted): + log_base, log_length = x + base_height = np.exp(log_base) + length = np.exp(log_length) + + if accepted: + print("Optimium base_height=%fm, h=%fm, impedance=%s Ohms" % \ + (base_height, length, monopole.impedance(freq, base_height, length))) + else: + print("Local_minimum=%fm, h=%fm, impedance=%s Ohms" % \ + (base_height, length, monopole.impedance(freq, base_height, length))) -# Starting value -freq = 134.5 -x0 = [-2.0, 0.0] -# Carry out the minimization -log_base, log_length = scipy.optimize.fmin(target, x0) +if __name__=="__main__": + parser = argparse.ArgumentParser(description='Optimize a monopole antenna.') + parser.add_argument('--target-impedance', type=float, default=50.0, help='Target for the optimized impedance') + parser.add_argument('--basinhopping', action="store_true", help='Use basinhopping') + args = parser.parse_args() -base_height = np.exp(log_base) -length = np.exp(log_length) + # Starting value + freq = 134.5 + x0 = [-2.0, 1.0] + target_impedance = args.target_impedance + + # Carry out the minimization -print "Optimium base_height=%fm, h=%fm, impedance=%s Ohms" % \ - (base_height, length, monopole.impedance(freq, base_height, length)) + if args.basinhopping: + result = scipy.optimize.basinhopping(target, x0, disp=True, T=1.0, niter_success=10) + else: + result = scipy.optimize.minimize(target, x0, method='Nelder-Mead') + + print("") + print("***********************************************************************") + print("* OPTIMIZATION COMPLETED *") + print("***********************************************************************") + print_result(result.x, None, True) diff --git a/PyNEC/example/radiation_pattern.py b/PyNEC/example/radiation_pattern.py index 7f0842c..39a3084 100644 --- a/PyNEC/example/radiation_pattern.py +++ b/PyNEC/example/radiation_pattern.py @@ -36,18 +36,18 @@ def geometry(freq, base, length): ipt = nec.get_input_parameters(0) z = ipt.get_impedance() -print("Impedance is {}".format(z)) +print(("Impedance is {}".format(z))) rpt = nec.get_radiation_pattern(0) complex_e_field = rpt.get_e_theta() e = complex_e_field.reshape((30,30)) -print(complex_e_field.size) +print((complex_e_field.size)) for t in range(30): for p in range(30): pass - print e[t, p] + print(e[t, p]) -print dir(rpt) +print(dir(rpt)) diff --git a/PyNEC/example/test_ne_nh.py b/PyNEC/example/test_ne_nh.py index 4a13d21..2b08584 100644 --- a/PyNEC/example/test_ne_nh.py +++ b/PyNEC/example/test_ne_nh.py @@ -53,4 +53,4 @@ ne = context.get_near_field_pattern(0) nh = context.get_near_field_pattern(1) -print ne \ No newline at end of file +print(ne) \ No newline at end of file From 8506fce34f9cc83c507fe9a61a6ad3b5578b50da Mon Sep 17 00:00:00 2001 From: tmolteno Date: Fri, 6 Sep 2019 09:48:40 +1200 Subject: [PATCH 18/34] Minor README update --- PyNEC/example/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/PyNEC/example/README.md b/PyNEC/example/README.md index 6989ece..0b242c8 100644 --- a/PyNEC/example/README.md +++ b/PyNEC/example/README.md @@ -12,3 +12,4 @@ To optimize the monopole design to achieve a particular impedance, try python3 optimized.py --basinhopping --target-impedance=110 +This code uses standard scipy optimizers to find the best solution. From 8e20f2425b9d397b17b5a0b2d5abe2cd91249617 Mon Sep 17 00:00:00 2001 From: Ralf Schlatterbeck Date: Thu, 20 Feb 2020 10:07:00 +0100 Subject: [PATCH 19/34] Fix parameters of multiple_patch This only takes three coordinates (SM card) according to nec docs. --- PyNEC/interface_files/c_geometry.i | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/PyNEC/interface_files/c_geometry.i b/PyNEC/interface_files/c_geometry.i index 2008f7b..8c2a0b2 100644 --- a/PyNEC/interface_files/c_geometry.i +++ b/PyNEC/interface_files/c_geometry.i @@ -255,18 +255,13 @@ public: \param ax3 The x_coordinate of corner 3. \param ay3 The y_coordinate of corner 3. \param az3 The z_coordinate of corner 3. - - \param ax4 The x_coordinate of corner 4. - \param ay4 The x_coordinate of corner 4. - \param az4 The x_coordinate of corner 4. */ void multiple_patch( int nx, int ny, nec_float ax1, nec_float ay1, nec_float az1, nec_float ax2, nec_float ay2, nec_float az2, - nec_float ax3, nec_float ay3, nec_float az3, - nec_float ax4, nec_float ay4, nec_float az4 ) + nec_float ax3, nec_float ay3, nec_float az3 ) { - return self->patch( nx, ny, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, ax4, ay4, az4 ); + return self->patch( nx, ny, ax1, ay1, az1, ax2, ay2, az2, ax3, ay3, az3, 0, 0, 0 ); } } From 225161c493628fa8c89b1cba707a1590ff3e9244 Mon Sep 17 00:00:00 2001 From: tmolteno Date: Thu, 14 May 2020 11:32:53 +1200 Subject: [PATCH 20/34] Update with a requested fix by user slawkory. Also fix an intger division bug introduced with the shift to python3. Closes #11, #14 --- PyNEC/example/context_clean.py | 4 ++-- PyNEC/example/logperiodic_opt.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PyNEC/example/context_clean.py b/PyNEC/example/context_clean.py index 9caaebd..4f4a3d3 100644 --- a/PyNEC/example/context_clean.py +++ b/PyNEC/example/context_clean.py @@ -101,10 +101,10 @@ def get_geometry(self): def set_extended_thin_wire_kernel(self, enable): if enable: debug ("EK", 0) - self.context.set_extended_thin_wire_kernel(1) + self.context.set_extended_thin_wire_kernel(True) else: debug ("EK", -1) - self.context.set_extended_thin_wire_kernel(0) + self.context.set_extended_thin_wire_kernel(False) def geometry_complete(self, ground_plane, current_expansion=True): no_ground_plane = 0 diff --git a/PyNEC/example/logperiodic_opt.py b/PyNEC/example/logperiodic_opt.py index b9617df..0a4ecd5 100644 --- a/PyNEC/example/logperiodic_opt.py +++ b/PyNEC/example/logperiodic_opt.py @@ -15,7 +15,7 @@ brass_conductivity = 15600000 # mhos -tl_impedance = 75 +tl_impedance = 75.0 def geometry_logperiodic(l_1, x_1, tau): """ @@ -45,7 +45,7 @@ def geometry_logperiodic(l_1, x_1, tau): nr_segments = int(math.ceil(50*l_i/wavelength)) # TODO this might vary when sweeping even! #print nr_segments - dipole_center_segs[dipole_tag] = nr_segments / 2 + 1 + dipole_center_segs[dipole_tag] = nr_segments // 2 + 1 center = np.array([x_i, 0, 0]) half_height = np.array([0 , 0, l_i/2.0]) @@ -64,7 +64,7 @@ def geometry_logperiodic(l_1, x_1, tau): # The 6th tag is the smallest tag is the source element for dipole in range(0, dipoles_count - 1): - src_tag = 1 + dipole # NEC indexing + src_tag = int(1 + dipole) # NEC indexing src_seg = dipole_center_segs[src_tag] dst_tag = src_tag + 1 From 14192582fe96d0aef093c3db51730c11877d30e4 Mon Sep 17 00:00:00 2001 From: tmolteno Date: Thu, 14 May 2020 11:35:58 +1200 Subject: [PATCH 21/34] Version bump --- PyNEC/CHANGES.md | 4 ++++ PyNEC/setup.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 PyNEC/CHANGES.md diff --git a/PyNEC/CHANGES.md b/PyNEC/CHANGES.md new file mode 100644 index 0000000..b22db73 --- /dev/null +++ b/PyNEC/CHANGES.md @@ -0,0 +1,4 @@ +### Version 1.7.3.6: + +* Update with a requested fix by user slawkory in context_clean.py +* Also fix an intger division bug introduced with the shift to python3 in logperiodic_opt.py diff --git a/PyNEC/setup.py b/PyNEC/setup.py index 5306c6c..6d2a6ed 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -49,7 +49,7 @@ long_description = fh.read() setuptools.setup (name = 'PyNEC', - version = '1.7.3.5', + version = '1.7.3.6', author = "Tim Molteno", author_email = "tim@physics.otago.ac.nz", url = "http://github.com/tmolteno/python-necpp", @@ -68,5 +68,6 @@ "Topic :: Scientific/Engineering", "Topic :: Communications :: Ham Radio", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + 'Programming Language :: Python :: 3', "Intended Audience :: Science/Research"] ) From 97c9ff79d0e035a0aaae61dc0ce2370d078a87ae Mon Sep 17 00:00:00 2001 From: Electro707 Date: Thu, 13 Jan 2022 22:53:57 -0500 Subject: [PATCH 22/34] Added pyroject --- PyNEC/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 PyNEC/pyproject.toml diff --git a/PyNEC/pyproject.toml b/PyNEC/pyproject.toml new file mode 100644 index 0000000..4973c84 --- /dev/null +++ b/PyNEC/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "numpy"] +build-backend = "setuptools.build_meta" From afbb3234d539085fbb90bcc1baf458b26662b88f Mon Sep 17 00:00:00 2001 From: Benitoite Date: Wed, 15 Mar 2023 11:38:26 -0700 Subject: [PATCH 23/34] update swig command per solution https://github.com/tmolteno/python-necpp/issues/19#issuecomment-1469623955 --- PyNEC/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyNEC/build.sh b/PyNEC/build.sh index 728e305..4785138 100755 --- a/PyNEC/build.sh +++ b/PyNEC/build.sh @@ -14,5 +14,5 @@ make -f Makefile.git cd ${DIR} # Build PyNEC -swig3.0 -Wall -v -c++ -python PyNEC.i +swig -Wall -v -c++ -python PyNEC.i python3 setup.py build From e63115ca5e317be9f6137cc7d8e43257afea3fb3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:45:04 +0000 Subject: [PATCH 24/34] Initial plan From 8ac49636d29e1de241f671c34165609bca7ce3b8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:51:22 +0000 Subject: [PATCH 25/34] Add GitHub Actions workflow for building wheels with cibuildwheel Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- .github/workflows/build-wheels.yml | 147 +++++++++++++++++++++++++++++ necpp/pyproject.toml | 3 + 2 files changed, 150 insertions(+) create mode 100644 .github/workflows/build-wheels.yml create mode 100644 necpp/pyproject.toml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 0000000..d9491d6 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,147 @@ +name: Build and upload to PyPI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels for ${{ matrix.package }} on ${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} + strategy: + matrix: + include: + # PyNEC builds + - package: PyNEC + os: linux + runs-on: ubuntu-latest + - package: PyNEC + os: macos-intel + runs-on: macos-13 + - package: PyNEC + os: macos-arm + runs-on: macos-latest + # necpp builds + - package: necpp + os: linux + runs-on: ubuntu-latest + - package: necpp + os: macos-intel + runs-on: macos-13 + - package: necpp + os: macos-arm + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install swig autoconf automake libtool + + - name: Configure necpp_src + shell: bash + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + shell: bash + run: | + cd ${{ matrix.package }} + ln -s ../necpp_src . + if [ "${{ matrix.package }}" = "PyNEC" ]; then + swig -Wall -c++ -python PyNEC.i + else + swig -I../necpp_src/src/ -python necpp.i + fi + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.5 + env: + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_SKIP: "*-musllinux_*" + CIBW_BUILD_VERBOSITY: 1 + with: + package-dir: ${{ matrix.package }} + output-dir: wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + strategy: + matrix: + package: [PyNEC, necpp] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Configure necpp_src + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + run: | + cd ${{ matrix.package }} + ln -s ../necpp_src . + if [ "${{ matrix.package }}" = "PyNEC" ]; then + swig -Wall -c++ -python PyNEC.i + else + swig -I../necpp_src/src/ -python necpp.i + fi + + - name: Build sdist + run: | + cd ${{ matrix.package }} + pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist-${{ matrix.package }} + path: ${{ matrix.package }}/dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/necpp/pyproject.toml b/necpp/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/necpp/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" From 7e1220b11830ca4510afb7bcc789f908b498fb7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:55:04 +0000 Subject: [PATCH 26/34] Remove Python 3.8 (EOL) and fix artifact naming Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- .github/workflows/build-wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index d9491d6..cd96d05 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -75,7 +75,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: @@ -84,7 +84,7 @@ jobs: - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }}-${{ strategy.job-index }} + name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: From 649b59825f5e1f6b43278a3c3e622c208cba1164 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:56:18 +0000 Subject: [PATCH 27/34] Add explicit permissions to workflow jobs for security Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- .github/workflows/build-wheels.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index cd96d05..bf81d64 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -14,6 +14,8 @@ jobs: build_wheels: name: Build wheels for ${{ matrix.package }} on ${{ matrix.os }} runs-on: ${{ matrix.runs-on }} + permissions: + contents: read strategy: matrix: include: @@ -90,6 +92,8 @@ jobs: build_sdist: name: Build source distribution runs-on: ubuntu-latest + permissions: + contents: read strategy: matrix: package: [PyNEC, necpp] From e52dd4f9e46726b7f25945903566e8ef27ea78bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 5 Jan 2026 22:16:51 +0000 Subject: [PATCH 28/34] Split workflow into separate files for PyNEC and necpp Co-authored-by: tmolteno <85630+tmolteno@users.noreply.github.com> --- ...uild-wheels.yml => build-necpp-wheels.yml} | 55 +++----- .github/workflows/build-pynec-wheels.yml | 126 ++++++++++++++++++ 2 files changed, 141 insertions(+), 40 deletions(-) rename .github/workflows/{build-wheels.yml => build-necpp-wheels.yml} (66%) create mode 100644 .github/workflows/build-pynec-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-necpp-wheels.yml similarity index 66% rename from .github/workflows/build-wheels.yml rename to .github/workflows/build-necpp-wheels.yml index bf81d64..952227e 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -1,4 +1,4 @@ -name: Build and upload to PyPI +name: Build and upload necpp to PyPI on: workflow_dispatch: @@ -12,32 +12,18 @@ on: jobs: build_wheels: - name: Build wheels for ${{ matrix.package }} on ${{ matrix.os }} + name: Build necpp wheels on ${{ matrix.os }} runs-on: ${{ matrix.runs-on }} permissions: contents: read strategy: matrix: include: - # PyNEC builds - - package: PyNEC - os: linux + - os: linux runs-on: ubuntu-latest - - package: PyNEC - os: macos-intel + - os: macos-intel runs-on: macos-13 - - package: PyNEC - os: macos-arm - runs-on: macos-latest - # necpp builds - - package: necpp - os: linux - runs-on: ubuntu-latest - - package: necpp - os: macos-intel - runs-on: macos-13 - - package: necpp - os: macos-arm + - os: macos-arm runs-on: macos-latest steps: @@ -66,13 +52,9 @@ jobs: - name: Setup package directory and generate SWIG wrapper shell: bash run: | - cd ${{ matrix.package }} + cd necpp ln -s ../necpp_src . - if [ "${{ matrix.package }}" = "PyNEC" ]; then - swig -Wall -c++ -python PyNEC.i - else - swig -I../necpp_src/src/ -python necpp.i - fi + swig -I../necpp_src/src/ -python necpp.i - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 @@ -81,22 +63,19 @@ jobs: CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: - package-dir: ${{ matrix.package }} + package-dir: necpp output-dir: wheelhouse - uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.package }}-${{ matrix.os }} + name: cibw-wheels-necpp-${{ matrix.os }} path: ./wheelhouse/*.whl build_sdist: - name: Build source distribution + name: Build necpp source distribution runs-on: ubuntu-latest permissions: contents: read - strategy: - matrix: - package: [PyNEC, necpp] steps: - uses: actions/checkout@v4 with: @@ -115,23 +94,19 @@ jobs: - name: Setup package directory and generate SWIG wrapper run: | - cd ${{ matrix.package }} + cd necpp ln -s ../necpp_src . - if [ "${{ matrix.package }}" = "PyNEC" ]; then - swig -Wall -c++ -python PyNEC.i - else - swig -I../necpp_src/src/ -python necpp.i - fi + swig -I../necpp_src/src/ -python necpp.i - name: Build sdist run: | - cd ${{ matrix.package }} + cd necpp pipx run build --sdist - uses: actions/upload-artifact@v4 with: - name: cibw-sdist-${{ matrix.package }} - path: ${{ matrix.package }}/dist/*.tar.gz + name: cibw-sdist-necpp + path: necpp/dist/*.tar.gz upload_pypi: needs: [build_wheels, build_sdist] diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml new file mode 100644 index 0000000..b78073f --- /dev/null +++ b/.github/workflows/build-pynec-wheels.yml @@ -0,0 +1,126 @@ +name: Build and upload PyNEC to PyPI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build_wheels: + name: Build PyNEC wheels on ${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} + permissions: + contents: read + strategy: + matrix: + include: + - os: linux + runs-on: ubuntu-latest + - os: macos-intel + runs-on: macos-13 + - os: macos-arm + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Install build dependencies (macOS) + if: runner.os == 'macOS' + run: | + brew install swig autoconf automake libtool + + - name: Configure necpp_src + shell: bash + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + shell: bash + run: | + cd PyNEC + ln -s ../necpp_src . + swig -Wall -c++ -python PyNEC.i + + - name: Build wheels + uses: pypa/cibuildwheel@v2.16.5 + env: + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + CIBW_SKIP: "*-musllinux_*" + CIBW_BUILD_VERBOSITY: 1 + with: + package-dir: PyNEC + output-dir: wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-pynec-${{ matrix.os }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build PyNEC source distribution + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y swig autoconf automake libtool + + - name: Configure necpp_src + run: | + cd necpp_src + make -f Makefile.git + ./configure --without-lapack + + - name: Setup package directory and generate SWIG wrapper + run: | + cd PyNEC + ln -s ../necpp_src . + swig -Wall -c++ -python PyNEC.i + + - name: Build sdist + run: | + cd PyNEC + pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist-pynec + path: PyNEC/dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: pypi + permissions: + id-token: write + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 From b2dde1ef2539f11eda2a90ef6246e00ee9a51c96 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 11:24:12 +1300 Subject: [PATCH 29/34] Bump to Mac-15 as 13 deprecated --- .github/workflows/build-necpp-wheels.yml | 2 +- .github/workflows/build-pynec-wheels.yml | 2 +- Makefile | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index 952227e..4f396ce 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -22,7 +22,7 @@ jobs: - os: linux runs-on: ubuntu-latest - os: macos-intel - runs-on: macos-13 + runs-on: macos-15 - os: macos-arm runs-on: macos-latest diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index b78073f..9e3e7ee 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -22,7 +22,7 @@ jobs: - os: linux runs-on: ubuntu-latest - os: macos-intel - runs-on: macos-13 + runs-on: macos-15 - os: macos-arm runs-on: macos-latest diff --git a/Makefile b/Makefile index 7442de6..dd1eb58 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -PLAT=manylinux1_x86_64 -DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64 +PLAT=manylinux2_x86_28 +DOCKER_IMAGE=quay.io/pypa/manylinux2014_x86_64 PRE_CMD= docker-wheels: docker run --rm -e PLAT=${PLAT} -v `pwd`:/io ${DOCKER_IMAGE} ${PRE_CMD} /io/build_wheels.sh auditwheel repair /output/mylibrary*whl -w /output - + install: docker pull ${DOCKER_IMAGE} From 3c1523235414e0ad99cf45931deb18de6d6c2be5 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:00:45 +1300 Subject: [PATCH 30/34] Add Python 3.13 to CI build --- .github/workflows/build-necpp-wheels.yml | 2 +- .github/workflows/build-pynec-wheels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index 4f396ce..f2ce2ba 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -59,7 +59,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index 9e3e7ee..c5a3c63 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -59,7 +59,7 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.16.5 env: - CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" CIBW_SKIP: "*-musllinux_*" CIBW_BUILD_VERBOSITY: 1 with: From aa296567a978ab2ca10a8d473bdc7aee8f9f55e9 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:08:44 +1300 Subject: [PATCH 31/34] Version bump --- PyNEC/setup.py | 73 ++++++++++++++++++++++++++-------------------- necpp/setup.py | 79 ++++++++++++++++++++++++++++---------------------- 2 files changed, 86 insertions(+), 66 deletions(-) diff --git a/PyNEC/setup.py b/PyNEC/setup.py index 6d2a6ed..bc33761 100644 --- a/PyNEC/setup.py +++ b/PyNEC/setup.py @@ -7,24 +7,30 @@ """ import distutils.sysconfig -from glob import glob import os +from glob import glob + import numpy as np import setuptools # Remove silly flags from the compilation to avoid warnings. -#cfg_vars = distutils.sysconfig.get_config_vars() -#for key, value in cfg_vars.items(): +# cfg_vars = distutils.sysconfig.get_config_vars() +# for key, value in cfg_vars.items(): # if type(value) == str: # cfg_vars[key] = value.replace("-Wstrict-prototypes", "") -# Generate a list of the sources. +# Generate a list of the sources. nec_sources = [] -nec_sources.extend([fn for fn in glob('necpp_src/src/*.cpp') - if not os.path.basename(fn).endswith('_tb.cpp') - if not os.path.basename(fn).startswith('net_solve.cpp') - if not os.path.basename(fn).startswith('nec2cpp.cpp') - if not os.path.basename(fn).startswith('necDiff.cpp')]) +nec_sources.extend( + [ + fn + for fn in glob("necpp_src/src/*.cpp") + if not os.path.basename(fn).endswith("_tb.cpp") + if not os.path.basename(fn).startswith("net_solve.cpp") + if not os.path.basename(fn).startswith("nec2cpp.cpp") + if not os.path.basename(fn).startswith("necDiff.cpp") + ] +) nec_sources.extend(glob("PyNEC_wrap.cxx")) nec_headers = [] @@ -35,39 +41,44 @@ # At the moment, the config.h file is needed, and this should be generated from the ./configure # command in the parent directory. Use ./configure --without-lapack to avoid dependance on LAPACK # -necpp_module = setuptools.Extension('_PyNEC', +necpp_module = setuptools.Extension( + "_PyNEC", sources=nec_sources, - - include_dirs=[np.get_include(), 'necpp_src/src', 'necpp_src/', 'necpp_src/win32/'], - extra_compile_args = ['-fPIC'], - extra_link_args = ['-lstdc++'], + include_dirs=[np.get_include(), "necpp_src/src", "necpp_src/", "necpp_src/win32/"], + extra_compile_args=["-fPIC"], + extra_link_args=["-lstdc++"], depends=nec_headers, - define_macros=[('BUILD_PYTHON', '1'), ('NPY_NO_DEPRECATED_API','NPY_1_7_API_VERSION')] - ) + define_macros=[ + ("BUILD_PYTHON", "1"), + ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), + ], +) with open("README.md", "r") as fh: long_description = fh.read() - -setuptools.setup (name = 'PyNEC', - version = '1.7.3.6', - author = "Tim Molteno", - author_email = "tim@physics.otago.ac.nz", - url = "http://github.com/tmolteno/python-necpp", - keywords = "nec2 nec2++ antenna electromagnetism radio", - description = "Python Antenna Simulation Module (nec2++) object-oriented interface", + +setuptools.setup( + name="PyNEC", + version="1.7.4", + author="Tim Molteno", + author_email="tim@physics.otago.ac.nz", + url="http://github.com/tmolteno/python-necpp", + keywords="nec2 nec2++ antenna electromagnetism radio", + description="Python Antenna Simulation Module (nec2++) object-oriented interface", long_description=long_description, long_description_content_type="text/markdown", include_package_data=True, - data_files=[('examples', ['example/test_rp.py'])], - ext_modules = [necpp_module], - requires = ['numpy'], - py_modules = ["PyNEC"], - license='GPLv2', + data_files=[("examples", ["example/test_rp.py"])], + ext_modules=[necpp_module], + requires=["numpy"], + py_modules=["PyNEC"], + license="GPLv2", classifiers=[ "Development Status :: 5 - Production/Stable", "Topic :: Scientific/Engineering", "Topic :: Communications :: Ham Radio", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - 'Programming Language :: Python :: 3', - "Intended Audience :: Science/Research"] + "Programming Language :: Python :: 3", + "Intended Audience :: Science/Research", + ], ) diff --git a/necpp/setup.py b/necpp/setup.py index f410e43..896ed98 100644 --- a/necpp/setup.py +++ b/necpp/setup.py @@ -1,19 +1,25 @@ #!/usr/bin/env python """ -setup.py file for necpp Python module. +setup.py file for necpp Python module. """ -from setuptools import setup, Extension -from glob import glob import os +from glob import glob + +from setuptools import Extension, setup nec_sources = [] -nec_sources.extend([fn for fn in glob('necpp_src/src/*.cpp') - if not os.path.basename(fn).endswith('_tb.cpp') - if not os.path.basename(fn).startswith('net_solve.cpp') - if not os.path.basename(fn).startswith('nec2cpp.cpp') - if not os.path.basename(fn).startswith('necDiff.cpp')]) +nec_sources.extend( + [ + fn + for fn in glob("necpp_src/src/*.cpp") + if not os.path.basename(fn).endswith("_tb.cpp") + if not os.path.basename(fn).startswith("net_solve.cpp") + if not os.path.basename(fn).startswith("nec2cpp.cpp") + if not os.path.basename(fn).startswith("necDiff.cpp") + ] +) nec_sources.extend(glob("necpp_wrap.c")) nec_headers = [] @@ -24,40 +30,43 @@ # At the moment, the config.h file is needed, and this should be generated from the ./configure # command in the parent directory. Use ./configure --without-lapack to avoid dependance on LAPACK # -necpp_module = Extension('_necpp', +necpp_module = Extension( + "_necpp", sources=nec_sources, - include_dirs=['necpp_src/src/', 'necpp_src/'], + include_dirs=["necpp_src/src/", "necpp_src/"], depends=nec_headers, - define_macros=[('BUILD_PYTHON', '1')] - ) + define_macros=[("BUILD_PYTHON", "1")], +) -with open('README.md') as f: +with open("README.md") as f: readme = f.read() -setup (name = 'necpp', - version = '1.7.3.5', - author = "Tim Molteno", - author_email = "tim@physics.otago.ac.nz", - url = "http://github.com/tmolteno/necpp", - keywords = "nec2 nec2++ antenna electromagnetism radio", - description = "Python Antenna Simulation Module (nec2++) C-style interface", +setup( + name="necpp", + version="1.7.4", + author="Tim Molteno", + author_email="tim@physics.otago.ac.nz", + url="http://github.com/tmolteno/necpp", + keywords="nec2 nec2++ antenna electromagnetism radio", + description="Python Antenna Simulation Module (nec2++) C-style interface", long_description=readme, long_description_content_type="text/markdown", include_package_data=True, - data_files=[('examples', ['necpp_src/example/test.py'])], - ext_modules = [necpp_module], - py_modules = ["necpp"], - license='GPLv2', + data_files=[("examples", ["necpp_src/example/test.py"])], + ext_modules=[necpp_module], + py_modules=["necpp"], + license="GPLv2", classifiers=[ - "Development Status :: 5 - Production/Stable", - "Topic :: Scientific/Engineering", - "Topic :: Communications :: Ham Radio", - "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - "Intended Audience :: Science/Research"] + "Development Status :: 5 - Production/Stable", + "Topic :: Scientific/Engineering", + "Topic :: Communications :: Ham Radio", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Intended Audience :: Science/Research", + ], ) From db34f239b92f746682717ad021b80b2dfc8bedb2 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:10:55 +1300 Subject: [PATCH 32/34] Update submodule --- necpp_src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/necpp_src b/necpp_src index 0af22b1..bc9aace 160000 --- a/necpp_src +++ b/necpp_src @@ -1 +1 @@ -Subproject commit 0af22b10d5b8e96da412009ef1178f1b4131cbb8 +Subproject commit bc9aaceedec50ac44dbed6e58a970b8007b346d3 From 5fc06f20035abc19713eed3144c01384097d08ea Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 12:14:14 +1300 Subject: [PATCH 33/34] Add gfortran as a dependency --- .github/workflows/build-necpp-wheels.yml | 6 +++--- .github/workflows/build-pynec-wheels.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index f2ce2ba..6a42efd 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -35,12 +35,12 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool + brew install swig autoconf automake libtool gfortran - name: Configure necpp_src shell: bash @@ -84,7 +84,7 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Configure necpp_src run: | diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index c5a3c63..0d02d2a 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -35,12 +35,12 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool + brew install swig autoconf automake libtool gfortran - name: Configure necpp_src shell: bash @@ -84,7 +84,7 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool + sudo apt-get install -y swig autoconf automake libtool gfortran - name: Configure necpp_src run: | From 99c1533c2063a950b33254f5119e200785147c74 Mon Sep 17 00:00:00 2001 From: Tim Molteno Date: Tue, 6 Jan 2026 15:54:15 +1300 Subject: [PATCH 34/34] Remove lapack and gfortran dependence --- .github/workflows/build-necpp-wheels.yml | 10 +++++----- .github/workflows/build-pynec-wheels.yml | 10 +++++----- necpp_src | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-necpp-wheels.yml b/.github/workflows/build-necpp-wheels.yml index 6a42efd..b1255a2 100644 --- a/.github/workflows/build-necpp-wheels.yml +++ b/.github/workflows/build-necpp-wheels.yml @@ -35,19 +35,19 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool gfortran + brew install swig autoconf automake libtool - name: Configure necpp_src shell: bash run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper shell: bash @@ -84,13 +84,13 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Configure necpp_src run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper run: | diff --git a/.github/workflows/build-pynec-wheels.yml b/.github/workflows/build-pynec-wheels.yml index 0d02d2a..bb89d90 100644 --- a/.github/workflows/build-pynec-wheels.yml +++ b/.github/workflows/build-pynec-wheels.yml @@ -35,19 +35,19 @@ jobs: if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Install build dependencies (macOS) if: runner.os == 'macOS' run: | - brew install swig autoconf automake libtool gfortran + brew install swig autoconf automake libtool - name: Configure necpp_src shell: bash run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper shell: bash @@ -84,13 +84,13 @@ jobs: - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y swig autoconf automake libtool gfortran + sudo apt-get install -y swig autoconf automake libtool - name: Configure necpp_src run: | cd necpp_src make -f Makefile.git - ./configure --without-lapack + ./configure - name: Setup package directory and generate SWIG wrapper run: | diff --git a/necpp_src b/necpp_src index bc9aace..049c556 160000 --- a/necpp_src +++ b/necpp_src @@ -1 +1 @@ -Subproject commit bc9aaceedec50ac44dbed6e58a970b8007b346d3 +Subproject commit 049c556cb10769410b760dcea7ef341a3e08f78b