Skip to content

Commit

Permalink
version issue fixed and check for freqs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkatz authored and mkatz committed Mar 31, 2023
1 parent a5aa738 commit 3fd61f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bbhx/waveformbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ def __call__(

start_and_end = self.xp.asarray([freqs_shaped[:, 0], freqs_shaped[:, -1],]).T

if not isinstance(data_freqs, self.xp.ndarray):
raise ValueError("Make sure if using Cupy or Numpy, the input freqs array is of the same type.")

inds_start_and_end = self.xp.asarray(
[
self.xp.searchsorted(data_freqs, temp, side="right")
Expand Down
8 changes: 8 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ def build_extensions(self):
pyLikelihood_ext,
] + extensions

for line in lines:
if line.startswith("Current Version"):
version_string = line.split("Current Version: ")[1].split("\n")[0]

with open("bbhx/_version.py", "w") as f:
f.write("__version__ = '{}'".format(version_string))

setup(
name="bbhx",
author="Michael Katz",
Expand All @@ -413,6 +420,7 @@ def build_extensions(self):
cmdclass={"build_ext": custom_build_ext},
# Since the package has c code, the egg cannot be zipped
zip_safe=False,
version=version_string,
python_requires=">=3.6",
)

Expand Down

0 comments on commit 3fd61f5

Please sign in to comment.