-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
169 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ script | |
*.egg-info | ||
build | ||
*.cfg | ||
*.pytest* | ||
*.pytest* | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"files.associations": { | ||
"pthread.h": "c", | ||
"arrayobject.h": "c", | ||
"__locale": "c" | ||
} | ||
"liveServer.settings.port": 5501 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
.PHONY: build | ||
.PHONY: clean test all install docs | ||
|
||
build: | ||
install: | ||
source bin/activate && pip install -e . | ||
|
||
clean: | ||
rm -rf build | ||
rm -rf setup.py | ||
poetry version patch | ||
poetry build | ||
rm -rf *.so | ||
|
||
test: | ||
pytest tests/*.py | ||
|
||
sphinx: | ||
cd docs && make html | ||
|
||
start-runner: | ||
actions-runner/run.sh | ||
|
||
publish: | ||
poetry publish | ||
all: clean install test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'gravitas' | ||
copyright = '2024, Liam Robinson' | ||
author = 'Liam Robinson' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.napoleon", | ||
] | ||
autosummary_generate = True | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = [] | ||
|
||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'alabaster' | ||
html_static_path = ['_static'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
gravitas | ||
======== | ||
|
||
.. automodule:: gravitas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. gravitas documentation master file, created by | ||
sphinx-quickstart on Sun Jan 28 00:58:46 2024. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to gravitas's documentation! | ||
==================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
gravitas |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
# [tool.cibuildwheel] | ||
skip = "pp* *-manylinux_i686 *_ppc64le *_s390x *-musllinux_aarch64" | ||
# This is actually used, lol | ||
|
||
[tool.cibuildwheel.linux] | ||
manylinux-x86_64-image = "manylinux2014" | ||
manylinux-aarch64-image = "manylinux2014" | ||
musllinux-x86_64-image = "musllinux_1_1" | ||
environment = {RUNNER_OS="Linux"} | ||
[project] | ||
name = "gravitas" | ||
version = "0.0.1" | ||
authors = [{name = "Liam Robinson", email = "liamers127@gmail.com"}] | ||
description = "Gravity field modeling for astrodynamics" | ||
requires-python = ">=3.9" | ||
|
||
[tool.cibuildwheel.macos] | ||
archs = "x86_64 arm64" | ||
test-skip = "*_universal2:arm64" | ||
# MACOS linker doesn't support stripping symbols | ||
environment = {RUNNER_OS="macOS"} | ||
|
||
[tool.cibuildwheel.windows] | ||
environment = { CFLAGS="Wall", LDFLAGS="" } | ||
[project.urls] | ||
Homepage = "https://example.com" | ||
Repository = "https://github.com/liamrobinson1/gravitas" | ||
Documentation = "https://yourprojectdocs.com" | ||
|
||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "numpy"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["setuptools>=42", "wheel", "numpy>=1.19.2", "pybind11>=2.11.0", "eigency>=1.6.0", "setuptools-scm>=8.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.cibuildwheel] | ||
build = ["cp312-*", "cp311-*"] | ||
skip = ["*win32*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,23 @@ | ||
from setuptools import setup, find_packages, Extension | ||
from setuptools.command.build_ext import build_ext | ||
|
||
from distutils.core import setup | ||
from pybind11.setup_helpers import Pybind11Extension | ||
import eigency | ||
import platform | ||
import os | ||
import numpy as np | ||
|
||
_SOURCES = [os.path.join('gravitas', x) for x in os.listdir('gravitas') if x.endswith('.c')] | ||
_INCDIR = ['gravitas', np.get_include()] | ||
std_arg = '-std=c++17' | ||
opt_arg = '-O3' | ||
if platform.system() == 'Windows': | ||
std_arg = '/std:c++17' | ||
opt_arg = '/O2' | ||
|
||
class CustomBuildExt(build_ext): | ||
def build_extensions(self): | ||
super().build_extensions() | ||
ext_modules = [ | ||
Pybind11Extension( | ||
name="gravitas", | ||
sources=[os.path.join("src", "python_bindings.cpp")], | ||
include_dirs=['src', *tuple(eigency.get_includes())], | ||
extra_compile_args=[std_arg, opt_arg], | ||
), | ||
] | ||
|
||
# _LIB_DIR | ||
setup( | ||
name='gravitas', | ||
version='0.1.25', | ||
packages=find_packages(), | ||
license='GPL-2', | ||
long_description="""High-fidelity gravity fields for satellite propagation""", | ||
long_description_content_type='text/markdown', | ||
author="Liam Robinson", | ||
author_email="robin502@purdue.edu", | ||
install_requires=['numpy'], | ||
package_data={'gravitas': ['libgrav.h']}, | ||
classifiers=[ | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)", | ||
"Operating System :: MacOS", | ||
"Operating System :: Microsoft :: Windows", | ||
], | ||
ext_modules=[ | ||
Extension( | ||
# the qualified name of the extension module to build | ||
'gravitas._grav', | ||
# the files to compile into our module relative to ``setup.py`` | ||
sources=_SOURCES, | ||
include_dirs=_INCDIR, | ||
extra_compile_args=['-O3', '-march=native', '-ffast-math', '-fopenmp'], | ||
), | ||
], | ||
cmdclass={ | ||
'build_ext': CustomBuildExt, | ||
}, | ||
zip_safe=False, # Allow the package to be unzipped without modification | ||
) | ||
setup(name = 'gravitas', | ||
ext_modules=ext_modules) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters