GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tmolteno/python-necpp: PyPI module for nec2++

BranchesTags
Open more actions menu

Latest commit

 

History

168 Commits
168 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
PyNEC
PyNEC
 
 
necpp
necpp
 
 
necpp_src @ d32ed8f
necpp_src @ d32ed8f
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
LICENSE.txt
LICENSE.txt
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
build_wheels.sh
build_wheels.sh
 
 
dev-requirements.txt
dev-requirements.txt
 
 

Repository files navigation

python-necpp: Antenna simulation in python

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.

Both are based on Tim Molteno ([email protected])'s code with major cleanup by Bart Coppens.

Quick Install

pip install PyNEC necpp

Wheels are built with the Python stable ABI (abi3): a single wheel per platform covers CPython 3.11 – 3.14 and newer.

Platform Wheel tag
Linux (x86_64, manylinux) cp311-abi3-manylinux_*
macOS (Apple Silicon) cp311-abi3-macosx_arm64
macOS (Intel) cp311-abi3-macosx_x86_64
Windows (x64) cp311-abi3-win_amd64

Free-threaded CPython (cp314t) is not covered by the stable ABI — install from the sdist there (a full-API build is produced automatically).

Which NEC2++ engine is bundled?

Every release pins the necpp_src git submodule to a specific necpp commit. Two places identify it:

  • the GitHub release notes and PyNEC/CHANGES.md name the necpp_src commit for each release;

  • the compiled extension embeds it as necpp_engine_sha=<commit> — verify any installed wheel with:

    strings "$(python -c 'import _PyNEC, pathlib; print(pathlib.Path(_PyNEC.__file__))')" | grep necpp_engine_sha

Build from Source

Uses uv for modern PEP 517 builds. Generating the wrappers requires SWIG >= 4.4.1 (4.5.1 recommended — older SWIG cannot emit stable-ABI-compatible code); installing from a release sdist needs no SWIG at all.

git clone --recursive https://github.com/tmolteno/python-necpp.git
cd python-necpp

# Build PyNEC
cd PyNEC && ./build.sh && uv build

# Build necpp
cd ../necpp && ./build.sh && uv build

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 :)

About

PyPI module for nec2++

Resources

Readme
GPL-2.0 license
Activity

Stars

82 stars

Watchers

8 watching

Forks

30 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.