Skip to content

Commit

Permalink
update dependencies for latest python version
Browse files Browse the repository at this point in the history
  • Loading branch information
majafranz committed Oct 8, 2024
1 parent 8b43ac3 commit eccf35e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
3 changes: 3 additions & 0 deletions examples/sample_qubo_qbsolv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
"""

raise NotImplementedError("Dwave's QBsolv is deprecated as of 2022. " \
"The hybrid Dwave solver requires refactoring.")

import sys
import logging
import pickle
Expand Down
4 changes: 4 additions & 0 deletions src/hepqpr/qallse/cli/func.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ def solve_neal(Q, seed=None, **kwargs):

def solve_qbsolv(Q, logfile=None, seed=None, **kwargs):
from hepqpr.qallse.other.stdout_redirect import capture_stdout

raise NotImplementedError("Dwave's QBsolv is deprecated as of 2022. " \
"The hybrid Dwave solver requires refactoring.")

from dwave_qbsolv import QBSolv
# generate seed for logging purpose
if seed is None:
Expand Down
5 changes: 4 additions & 1 deletion src/hepqpr/qallse/qallse_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import Union

import pandas as pd
from dwave_qbsolv import QBSolv
from .other.stdout_redirect import capture_stdout

from .data_structures import *
Expand Down Expand Up @@ -118,6 +117,10 @@ def sample_qubo(self, Q: TQubo = None, return_time=False, logfile: str = None, s
:return: a dimod response or a tuple (dimod response, exec_time)
(see `dimod.Response <https://docs.ocean.dwavesys.com/projects/dimod/en/latest/reference/response.html>`_)
"""
raise NotImplementedError("Dwave's QBsolv is deprecated as of 2022. " \
"The hybrid Dwave solver requires refactoring.")
from dwave_qbsolv import QBSolv

if Q is None: Q = self.to_qubo()
if seed is None:
import random
Expand Down
4 changes: 2 additions & 2 deletions src/hepqpr/qallse/seeding/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, nbSpacepoints):
# number of outer doublet (other spacepoint has a bigger radius)
self.nOuter = np.zeros(nbSpacepoints, dtype=np.int64)
# True if at least one inner and one outer doublet, false otherwise
self.good = np.zeros(nbSpacepoints, dtype=np.bool8)
self.good = np.zeros(nbSpacepoints, dtype=np.bool)


class DoubletStorage:
Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(self, spacepoints, config):
"""

# Contains the type of the spacepoints (Pixel = true, SCT = False)
self.type = np.zeros(spacepoints.shape[0], dtype=np.bool8)
self.type = np.zeros(spacepoints.shape[0], dtype=np.bool)
# Contains the z coordinate of the spacepoints
self.z = np.zeros(spacepoints.shape[0])
# Contains the r coordinate of the spacepoints
Expand Down
4 changes: 2 additions & 2 deletions src/hepqpr/qallse/seeding/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def scale_z(z,minz,maxz,nbins):
minz = np.abs(minz)
maxz = np.abs(maxz)
z = np.add(minz,z)
return (z * float(nbins-1) / (minz+maxz)).astype(np.int)
return (z * float(nbins-1) / (minz+maxz)).astype(np.int64)

def scale_phi(phi, phi_bins):
"""
bin phi
"""
return (phi * float(phi_bins-1) / (2*np.pi)).astype(np.int)
return (phi * float(phi_bins-1) / (2*np.pi)).astype(np.int64)


#calc_r, theta, eta, phi, draw_scatter from Steve's notebook
Expand Down
24 changes: 10 additions & 14 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

setuptools.setup(
name='hepqpr-qallse',
version='0.1.0',
version='0.2.0',
author='Lucy Linder',
author_email='[email protected]',
description='High Energy Physics, Quantum Pattern Recognition using QUBO/D-Wave',
license='Apache License 2.0',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/derlin/TODO',
url='https://github.com/derlin/hepqpr-qallse',

packages=setuptools.find_packages(),
package_data={'': ['*.csv', '**/*.csv']}, # include all *.csv under src
Expand All @@ -41,17 +41,13 @@
'Operating System :: OS Independent'
],
install_requires=[
'numpy>=1.14.0,<1.16.0',
'pandas>=0.23,<0.24',
'trackml',
'dwave-qbsolv==0.2.10',
'dwave-neal==0.4.5',
'click==7.0',
'jsonschema<3.0.0',
'plotly>=3.4,<3.5'
'numpy==2.1.2',
'pandas==2.2.3',
'trackml @ git+https://github.com/LAL/trackml-library.git#egg=trackml-v2',
'dwave-neal==0.6.0',
'click==8.1.7',
'jsonschema==4.23.0',
'plotly==5.24.1',
],
dependency_links=[
'git+https://github.com/LAL/trackml-library.git#egg=trackml-v2',
],
python_requires='>=3.6',
python_requires='==3.13',
)

0 comments on commit eccf35e

Please sign in to comment.