Skip to content

Commit 7db8e14

Browse files
authored
Merge pull request #2 from astro-informatics/bintray_sunsetting
Bintray sunsetting
2 parents 50438c8 + 82cc5f9 commit 7db8e14

39 files changed

+2458
-602
lines changed

.github/workflows/cpp.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Tests
2+
3+
on: [push]
4+
5+
env:
6+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7+
BUILD_TYPE: Debug
8+
CC: gcc-10
9+
CXX: g++-10
10+
11+
jobs:
12+
build:
13+
# The CMake configure and build commands are platform agnostic and should work equally
14+
# well on Windows or Mac. You can convert this to a matrix build if you need
15+
# cross-platform coverage.
16+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Set up Python 3.8
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: 3.8
25+
26+
- name: Create Build Environment
27+
run: |
28+
pip install cmake==3.15.3
29+
pip install --upgrade pip wheel conan
30+
cmake --version
31+
cmake -E make_directory ${{runner.workspace}}/build
32+
- name: Configure CMake
33+
# # Use a bash shell so we can use the same syntax for environment variable
34+
# # access regardless of the host operating system
35+
# shell: bash
36+
working-directory: ${{runner.workspace}}/build
37+
# Note the current convention is to use the -S and -B options here to specify source
38+
# and build directories, but this is only available with CMake 3.13 and higher.
39+
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
40+
run: |
41+
sudo apt-get install -y doxygen
42+
sudo apt-get install libfftw3-dev libfftw3-doc
43+
pip install conan
44+
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Dpython=False -Dconan_deps=True
45+
- name: Build
46+
continue-on-error: true
47+
id: Build
48+
working-directory: ${{runner.workspace}}/build
49+
run: |
50+
cmake --build . --config $BUILD_TYPE
51+
# Execute the build. You can specify a specific target with "--target <NAME>"
52+
# run: make
53+
54+
- name: rebuild
55+
continue-on-error: true
56+
working-directory: ${{runner.workspace}}/build
57+
# Execute the build. You can specify a specific target with "--target <NAME>"
58+
if: steps.Build.outcome=='failure' # check the step outcome, retry 1st time
59+
run: cmake --build . --config $BUILD_TYPE
60+
61+
- name: Test
62+
working-directory: ${{runner.workspace}}/build
63+
# Execute tests defined by the CMake configuration.
64+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
65+
run: ctest -C $BUILD_TYPE

CMakeLists.txt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
cmake_minimum_required(VERSION 3.12)
2+
project(
3+
flag
4+
VERSION "0.0.1"
5+
DESCRIPTION "Fast Fourier-Laguerre transform on the ball"
6+
HOMEPAGE_URL "https://github.com/astro-informatics/flag"
7+
LANGUAGES C)
8+
9+
option(tests "Enable testing" ON)
10+
option(conan_deps "Download ssht using conan" ON)
11+
if(NOT WIN32)
12+
option(fPIC "Enable position independent code" ON)
13+
endif()
14+
15+
if(NOT CMAKE_BUILD_TYPE)
16+
set(CMAKE_BUILD_TYPE "Debug")
17+
endif()
18+
19+
include(CTest)
20+
if(conan_deps OR CONAN_EDITABLE_MODE)
21+
include("${PROJECT_SOURCE_DIR}/cmake/conan_dependencies.cmake")
22+
endif()
23+
if(EXISTS "${PROJECT_BINARY_DIR}/conan_paths.cmake")
24+
include("${PROJECT_BINARY_DIR}/conan_paths.cmake")
25+
elseif(EXISTS "${PROJECT_BINARY_DIR}/FindFFTW3.cmake")
26+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_BINARY_DIR}")
27+
else()
28+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
29+
endif()
30+
find_package(ssht REQUIRED)
31+
if(ssht_FOUND AND NOT TARGET ssht::ssht)
32+
message(FATAL_ERROR "NOT FOUND ${SSHT_LIBRARIES}")
33+
endif()
34+
find_package(FFTW3 REQUIRED)
35+
find_library(MATH_LIBRARY m)
36+
find_package(GSL REQUIRED)
37+
38+
add_subdirectory(src/main/c)
39+
if(tests)
40+
enable_testing()
41+
include("${PROJECT_SOURCE_DIR}/cmake/fetch_cmocka.cmake")
42+
add_subdirectory(src/test/c)
43+
endif()
44+
45+
if(NOT SKBUILD)
46+
include("${PROJECT_SOURCE_DIR}/cmake/exporting.cmake")
47+
else()
48+
find_package(PythonExtensions REQUIRED)
49+
find_package(Cython REQUIRED)
50+
find_package(NumPy REQUIRED)
51+
add_subdirectory(src/main/pyflag)
52+
endif()
53+
54+
# only run documentation if this is not a sub-project
55+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
56+
find_package(Doxygen)
57+
if(DOXYGEN_FOUND)
58+
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C "YES")
59+
set(DOXYGEN_EXTRACT_ALL "YES")
60+
set(DOXYGEN_FILE_PATTERNS *.h *.c)
61+
doxygen_add_docs(docs src/main/c src/test/c include)
62+
endif()
63+
endif()

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
include CMakeLists.txt
2+
include setup.py setup.cfg pyproject.toml
3+
include COPYRIGHT.txt LICENSE.md README.md
4+
include cmake/*.cmake
5+
include conanfile.txt
6+
include include/flag*.h
7+
recursive-include src/main/c *.c *.h CMakeLists.txt

README

Lines changed: 0 additions & 63 deletions
This file was deleted.

README.rst

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
.. image:: https://img.shields.io/badge/GitHub-src_flag-brightgreen.svg?style=flat
2+
:target: https://github.com/astro-informatics/src_flag
3+
.. image:: https://github.com/astro-informatics/src_flag/actions/workflows/cpp.yml/badge.svg
4+
:target: https://github.com/astro-informatics/src_flag/actions/workflows/cpp.yml
5+
.. image:: https://readthedocs.org/projects/ansicolortags/badge/?version=latest
6+
:target: https://astro-informatics.github.io/src_flag/
7+
.. image:: https://img.shields.io/badge/License-GPL-blue.svg
8+
:target: http://perso.crans.org/besson/LICENSE.html
9+
.. image:: http://img.shields.io/badge/arXiv-1205.0792-orange.svg?style=flat
10+
:target: https://arxiv.org/abs/1205.0792
11+
.. image:: http://img.shields.io/badge/arXiv-1110.6298-orange.svg?style=flat
12+
:target: https://arxiv.org/abs/1110.6298
13+
.. image:: http://img.shields.io/badge/arXiv-2105.05518-orange.svg?style=flat
14+
:target: https://arxiv.org/abs/2105.05518
15+
16+
|logo| FLAG: Fourier-LAGuerre transform
17+
================================
18+
19+
.. |logo| raw:: html
20+
21+
<img src="./doc/images/logo.jpg" align="center" height="52" width="60">
22+
23+
DESCRIPTION
24+
================================
25+
The FLAG code provides functionality to perform fast and exact Fourier-Laguerre and Fourier-Bessel transforms on the ball.
26+
27+
C INSTALLATION
28+
================================
29+
The primary C version of this code can be installed from source by running
30+
31+
.. code-block:: bash
32+
33+
git clone git@github.com:astro-informatics/src_flag.git
34+
cd src_flag
35+
mkdir build && cd build
36+
cmake .. && make
37+
38+
Following which one can check the installation by running
39+
40+
.. code-block:: bash
41+
42+
ctest
43+
44+
within the build directory.
45+
46+
PYTHON INSTALLATION
47+
================================
48+
This package can easily be installed from PyPi by running
49+
50+
.. code-block:: bash
51+
52+
pip install pyflag
53+
pip list
54+
55+
or alternatively from source by first compiling the C code and running
56+
57+
.. code-block:: bash
58+
59+
pip install .
60+
61+
from the root directory, following which the package may be tested by running
62+
63+
.. code-block:: bash
64+
65+
pytest
66+
67+
within the root directory.
68+
69+
MATLAB INSTALLATION
70+
================================
71+
Mex wrappers are available, however they are currently being sunsetted, so installing previously tagged versions is advised.
72+
73+
BASIC USAGE (PYTHON)
74+
================================
75+
First install flag for python, then you can call it from any python script to perform forward and inverse flag transforms and their adjoints by
76+
77+
.. code-block:: python
78+
79+
import pyflag as flag
80+
import numpy as np
81+
82+
L = 10 # Angular bandlimit
83+
P = 5 # Radial bandlimit
84+
tau = 1 # Laguerre scaling factor
85+
spin = 0 # Spin of signal
86+
reality = 0 # Real or complex signals
87+
88+
# Create a random complex signal (c indexing)
89+
f = np.random.rand(P, L, 2*L-1) + 1j*np.random.rand(P, L, 2*L-1)
90+
f = f.flatten('C')
91+
92+
# Compute e.g. the Forward transform
93+
flmp = flag.flag_analysis(f, L, tau, P, spin, reality)
94+
95+
AUTHORS
96+
================================
97+
98+
`B. Leistedt <www.ixkael.com/blog>`_,
99+
`J. D. McEwen <www.jasonmcewen.org>`_, and
100+
`M. A. Price <https://scholar.google.com/citations?user=w7_VDLQAAAAJ&hl=en&authuser=1>`_
101+
102+
REFERENCES
103+
================================
104+
105+
.. code-block::
106+
107+
@article{price:2021:bayesian,
108+
author = {Matthew~A.~Price and Jason~D.~McEwen},
109+
title = {Bayesian variational regularization on the ball},
110+
journal = {ArXiv},
111+
eprint = {arXiv:2105.05518},
112+
year = 2021
113+
}
114+
115+
.. code-block::
116+
117+
@article{leistedt:2012:exact,
118+
author = {Boris~Leistedt and Jason~D.~McEwen},
119+
title = {Exact Wavelets on the Ball},
120+
journal = {IEEE Trans. Sig. Proc.},
121+
year = 2012,
122+
volume = {60},
123+
number = {12},
124+
pages = {6257-6269},
125+
doi = {10.1109/TSP.2012.2215030},
126+
}
127+
128+
.. code-block::
129+
130+
@article{McEwen:2011:novel,
131+
author = {Jason~D.~McEwen and Yves~Wiaux},
132+
title = {A novel sampling theorem on the sphere},
133+
journal = {IEEE Trans. Sig. Proc.},
134+
year = 2011,
135+
volume = {59},
136+
number = {12},
137+
pages = {5876-5887},
138+
doi = {10.1109/TSP.2011.2166394},
139+
}
140+
141+
LICENSE
142+
================================
143+
144+
FLAG package to perform fast wavelet transform on the sphere<br>
145+
Copyright (C) 2012 Boris Leistedt & Jason McEwen
146+
147+
This program is free software; you can redistribute it and/or
148+
modify it under the terms of the GNU General Public License
149+
as published by the Free Software Foundation; either version 2
150+
of the License, or (at your option) any later version.
151+
152+
This program is distributed in the hope that it will be useful,
153+
but WITHOUT ANY WARRANTY; without even the implied warranty of
154+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
155+
GNU General Public License for more details (LICENSE.txt).
156+
157+
You should have received a copy of the GNU General Public License
158+
along with this program; if not, write to the Free Software
159+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
160+
MA 02110-1301, USA.

0 commit comments

Comments
 (0)