Skip to content

Commit

Permalink
Merge pull request #29 from DifferentiableUniverseInitiative/u/EiffL/…
Browse files Browse the repository at this point in the history
…cleanup

Cleanup to finish code update, and move notebooks around
  • Loading branch information
EiffL committed Aug 3, 2021
2 parents 1a44b2c + 6ad4e0e commit 0d2ca1e
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 551 deletions.
15 changes: 8 additions & 7 deletions diffhod/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ def Zheng07SatsRelaxedBernoulli(Mhalo,
def NFWProfile(pos, concentration, Rvir, sample_shape, **kwargs):
'''
'''
pos = ed.as_random_variable(tfd.TransformedDistribution(
pos = ed.RandomVariable(tfd.TransformedDistribution(
distribution=tfd.VonMisesFisher(
tf.one_hot(tf.zeros_like(concentration, dtype=tf.int32), 3), 0),
bijector=tfb.AffineScalar(shift=pos,
scale=tf.expand_dims(ed.as_random_variable(
NFW(concentration, Rvir, name='radius'),
sample_shape=sample_shape),
axis=-1)),
bijector=tfb.Shift(pos)(tfb.Scale(
tf.expand_dims(ed.RandomVariable(NFW(concentration,
Rvir,
name='radius'),
sample_shape=sample_shape),
axis=-1))),
name='position'),
sample_shape=sample_shape)
sample_shape=sample_shape)
return pos
File renamed without changes.
203 changes: 203 additions & 0 deletions nb/dev/dhod_Ngal.ipynb

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion nb/dhod_zheng07.ipynb → nb/dev/dhod_zheng07.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.9.6"
}
},
"nbformat": 4,
Expand Down
212 changes: 0 additions & 212 deletions nb/dhod_Ngal.ipynb

This file was deleted.

259 changes: 131 additions & 128 deletions nb/power_spectra_comparison.ipynb

Large diffs are not rendered by default.

197 changes: 0 additions & 197 deletions nb/ps_test.ipynb

This file was deleted.

23 changes: 17 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#!/usr/bin/env python
from setuptools import setup, find_packages

__version__ = '0.1'

setup(name='diffhod',
version=__version__,
python_requires='>3.5.2',
description='differentiable HOD',
description="Differentiable Halo Occupation Distribution",
python_requires='>3.6',
author="DiffHOD developers",
packages=find_packages(),
install_requires=['tensorflow-probability', 'edward2'],
tests_require=['halotools'])
tests_require=['halotools'],
use_scm_version=True,
setup_requires=["setuptools_scm"],
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
])

0 comments on commit 0d2ca1e

Please sign in to comment.