Commit 06ce4084 authored by Benjy Marks's avatar Benjy Marks
Browse files

first version that compiles on conda

parent ced2848b
Pipeline #78533 passed with stage
in 1 minute and 28 seconds
{% set name = "radioSphere" %}
{% set data = load_setup_py_data(setup_file='../setup.py') %}
package:
name: {{ name|lower }}
version: 1.0.1 # {{ data.get('version') }}
version: 1.0.1
source:
# url: ./../dist/{{ name }}-1.0.0.tar.gz # for local testing
url: https://gricad-gitlab.univ-grenoble-alpes.fr/ttk/radioSphere/uploads/5aef14329123e2288e5a1ff34a233f6b/radioSphere-1.0.1.tar.gz
sha256: d2dcfdedafec16c8ecc7c88c9c2a99380273ca532dfa3b2899c9051bfb026034
url: https://gricad-gitlab.univ-grenoble-alpes.fr/ttk/radioSphere/uploads/cda47b0a4fb340a4ec94946b32bb79cb/radioSphere-1.0.1.tar.gz
sha256: 739f708e5dcd5472808ff92373be5d1d82027e7e7d106c7ac343cecae8e06dc0
build:
number: 0
......@@ -26,9 +24,8 @@ requirements:
- numpy x.x
- python
- scipy
- cython # to build the C++ projector for now
- cython
- tifffile
# - opencv-python
- pytest
run:
- python
......@@ -41,14 +38,13 @@ requirements:
test:
imports:
- radiosphere
- radiosphere.tests
- radioSphere
about:
home: "https://ttk.gricad-gitlab.univ-grenoble-alpes.fr/ttk/radioSphere"
license: GPL-2.0-or-later
license_family: GPL
license_file: LICENSE
license_file: LICENSE.md
summary: "Single-projection reconstruction technique for positioning monodisperse spheres in 3D with a divergent x-ray beam"
doc_url: https://ttk.gricad-pages.univ-grenoble-alpes.fr/radioSphere/
......
# How to deploy to conda-forge
1. Update the version number in `setup.py` and `meta.yaml`
2. Run `python setup.py sdist` -> this creates a tar.gz file in the dist folder.
3. Upload tar.gz folder somewhere. I have been making releases on the gitlab page and uploading them in the comments section. Get a link to this file and put it in meta.yaml
4. Run `openssl sha256 dist/radioSphere-{VERSION}.tar.gz` to get the sha256 and update it in the `meta.yaml` file`.
5. Go to the forked conda-forge repo in benjy's github and push the changes to `meta.yaml` to create the new builds for OSX, linux and windows
......@@ -12,13 +12,15 @@ version="1.0.1"
modules = ["DEM"]
packages = ["radioSphere", "radioSphere.DEM"]
# os.environ["clang"] = "g++-11"
if os.getenv('PREFIX') != None: # if we are compiling with conda
# Never look at this disgusting hack
if os.name == 'nt': # on windows, assumed to be building on conda
EIGEN_LOC = os.getenv('PREFIX') + '/Library'
elif os.getenv('PREFIX') != None: # if we are compiling with conda
EIGEN_LOC = os.getenv('PREFIX')
else:
EIGEN_LOC = "/opt/homebrew/Cellar/eigen/3.4.0_1" # on benjy's macbook pro installed with brew, this is so very very brittle
print(EIGEN_LOC)
# print(EIGEN_LOC)
def readConf(fileName, comments=["#"]):
"""
......@@ -47,9 +49,8 @@ setup(
cmdclass={'build_ext': build_ext},
ext_modules=[ Extension("projectSphereC3",
sources=["tools/projectSphereC3.cython/_projectSphereC.pyx",
"tools/projectSphereC3.cython/projectSphereC.cpp",
"tools/projectSphereC3.cython/projectSphereC.hpp"],
include_dirs=[numpy.get_include()],
"tools/projectSphereC3.cython/projectSphereC.cpp"],
include_dirs=[numpy.get_include(),'tools/projectSphereC3.cython/'],
extra_compile_args=['-fopenmp','-I/usr/local/include/eigen3', '-I/usr/include/eigen3', '-I' + EIGEN_LOC + '/include/eigen3'],
# extra_link_args=['-fopenmp'],
language='c++')],
......
......@@ -4,7 +4,7 @@ Implementation of tomopack by Stéphane Roux
import os
import numpy
import projectSphere
import radioSphere.projectSphere
import scipy.ndimage
from scipy.spatial import distance
......
......@@ -5,7 +5,7 @@
#include <omp.h>
#include "projectSphereC.hpp"
/* 2016-10-09 -- Edward Andò
/* 2016-10-09 -- Edward Andò
* Sphere projector in divergent geometry, based on Benjy Marks'
* Python implementation
*/
......@@ -46,7 +46,7 @@ void project( int nSdd, float * sddA,
/* map incoming arrays (spheres and detector) into eigen arrays,
* Careful, Eigen accesses in Y,X compared to python's X,Y
* Careful, Eigen accesses in Y,X compared to python's X,Y
* Eigen Arrays starting with capital letters */
Eigen::Map<Eigen::MatrixXf> Sph( spheres, three, nSpheres );
Eigen::Map<Eigen::MatrixXf> Rad( radii, nSpheres, 1 );
......@@ -89,7 +89,7 @@ void project( int nSdd, float * sddA,
// printf( "%f, %f, %f\n", line(0,0), line(1,0), line(2,0) );
// printf( "%f, %f, %f\n\n", lineNorm(0,0), lineNorm(1,0), lineNorm(2,0) );
length = 2.0 * std::sqrt( std::pow( lineNorm.dot( Sph.block<3,1>(0,sphere) ), 2)
- sphereCoordNormSquare
+ radiusSquare );
......@@ -122,8 +122,6 @@ void project( int nSdd, float * sddA,
// Det(h,v) = attenuationParams[0] * exp( - Det(h,v) * 1 );
// }
// }
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment