Skip to content

Commit

Permalink
Clean up packages and switch to Trust-Region optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
aarmey committed Nov 26, 2024
1 parent c4039ad commit daeda01
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 190 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# cellcommunication-pf2

Fully single-cell analysis of cell-to-cell communication.
7 changes: 3 additions & 4 deletions cellcommunicationpf2/cc_pf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pymanopt
from pymanopt import Problem
from pymanopt.manifolds import Stiefel
from pymanopt.optimizers import ConjugateGradient
from pymanopt.optimizers import TrustRegions


def project_data(tensor: np.ndarray, proj_matrix: np.ndarray) -> np.ndarray:
Expand Down Expand Up @@ -42,13 +42,12 @@ def objective_function(proj):
problem = Problem(manifold=manifold, cost=objective_function)

# Solve the problem
solver = ConjugateGradient(
verbosity=1, min_gradient_norm=1e-9, min_step_size=1e-12
solver = TrustRegions(
verbosity=0, min_gradient_norm=1e-9, min_step_size=1e-12
)
proj = solver.run(problem).point

U, _, Vt = np.linalg.svd(proj, full_matrices=False)

proj = U @ Vt

projections.append(proj)
Expand Down
10 changes: 2 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ license = "MIT"
requires-python = ">= 3.11"

dependencies = [
"numpy>=1.21,<2.1",
"numpy>=2.0.2",
"scipy>=1.12",
"tensorly~=0.9.0",
"tqdm>=4.66",
"cupy-cuda12x>=13.0",
"scikit-learn>=1.4.2",
"pacmap>=0.7.2",
"tlviz>=0.1.1",
"pymanopt>=2.2.1",
"autograd>=1.7.0",
]
Expand All @@ -33,7 +27,7 @@ build-backend = "hatchling.build"
managed = true
dev-dependencies = [
"pytest>=8.0",
"pytest-cov>=5.0",
"pytest-cov>=6.0",
"pyright>=1.1",
]

Expand Down
90 changes: 1 addition & 89 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,119 +10,31 @@
# universal: false

-e file:.
annoy==1.17.3
# via pacmap
autograd==1.7.0
# via cellcommunicationpf2
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
contourpy==1.3.0
# via matplotlib
coverage==7.6.1
# via pytest-cov
cupy-cuda12x==13.3.0
# via cellcommunicationpf2
cycler==0.12.1
# via matplotlib
fastrlock==0.8.2
# via cupy-cuda12x
fonttools==4.54.1
# via matplotlib
idna==3.10
# via requests
iniconfig==2.0.0
# via pytest
joblib==1.4.2
# via scikit-learn
kiwisolver==1.4.7
# via matplotlib
llvmlite==0.43.0
# via numba
matplotlib==3.9.2
# via tlviz
nodeenv==1.9.1
# via pyright
numba==0.60.0
# via pacmap
numpy==2.0.2
# via autograd
# via cellcommunicationpf2
# via contourpy
# via cupy-cuda12x
# via matplotlib
# via numba
# via pacmap
# via pandas
# via patsy
# via pymanopt
# via scikit-learn
# via scipy
# via statsmodels
# via tensorly
# via tlviz
# via xarray
packaging==24.1
# via matplotlib
# via pytest
# via statsmodels
# via xarray
pacmap==0.7.3
# via cellcommunicationpf2
pandas==2.2.3
# via statsmodels
# via tlviz
# via xarray
patsy==0.5.6
# via statsmodels
pillow==10.4.0
# via matplotlib
pluggy==1.5.0
# via pytest
pymanopt==2.2.1
# via cellcommunicationpf2
pyparsing==3.1.4
# via matplotlib
pyright==1.1.383
pytest==8.3.3
# via pytest-cov
pytest-cov==5.0.0
python-dateutil==2.9.0.post0
# via matplotlib
# via pandas
pytz==2024.2
# via pandas
requests==2.32.3
# via tlviz
scikit-learn==1.5.2
# via cellcommunicationpf2
# via pacmap
pytest-cov==6.0.0
scipy==1.14.1
# via cellcommunicationpf2
# via pymanopt
# via scikit-learn
# via statsmodels
# via tensorly
# via tlviz
six==1.16.0
# via patsy
# via python-dateutil
statsmodels==0.14.4
# via tlviz
tensorly==0.9.0
# via cellcommunicationpf2
threadpoolctl==3.5.0
# via scikit-learn
tlviz==0.1.1
# via cellcommunicationpf2
tqdm==4.66.5
# via cellcommunicationpf2
typing-extensions==4.12.2
# via pyright
tzdata==2024.2
# via pandas
urllib3==2.2.3
# via requests
xarray==2024.9.0
# via tlviz
89 changes: 0 additions & 89 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,104 +10,15 @@
# universal: false

-e file:.
annoy==1.17.3
# via pacmap
autograd==1.7.0
# via cellcommunicationpf2
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
contourpy==1.3.0
# via matplotlib
cupy-cuda12x==13.3.0
# via cellcommunicationpf2
cycler==0.12.1
# via matplotlib
fastrlock==0.8.2
# via cupy-cuda12x
fonttools==4.54.1
# via matplotlib
idna==3.10
# via requests
joblib==1.4.2
# via scikit-learn
kiwisolver==1.4.7
# via matplotlib
llvmlite==0.43.0
# via numba
matplotlib==3.9.2
# via tlviz
numba==0.60.0
# via pacmap
numpy==2.0.2
# via autograd
# via cellcommunicationpf2
# via contourpy
# via cupy-cuda12x
# via matplotlib
# via numba
# via pacmap
# via pandas
# via patsy
# via pymanopt
# via scikit-learn
# via scipy
# via statsmodels
# via tensorly
# via tlviz
# via xarray
packaging==24.1
# via matplotlib
# via statsmodels
# via xarray
pacmap==0.7.3
# via cellcommunicationpf2
pandas==2.2.3
# via statsmodels
# via tlviz
# via xarray
patsy==0.5.6
# via statsmodels
pillow==10.4.0
# via matplotlib
pymanopt==2.2.1
# via cellcommunicationpf2
pyparsing==3.1.4
# via matplotlib
python-dateutil==2.9.0.post0
# via matplotlib
# via pandas
pytz==2024.2
# via pandas
requests==2.32.3
# via tlviz
scikit-learn==1.5.2
# via cellcommunicationpf2
# via pacmap
scipy==1.14.1
# via cellcommunicationpf2
# via pymanopt
# via scikit-learn
# via statsmodels
# via tensorly
# via tlviz
six==1.16.0
# via patsy
# via python-dateutil
statsmodels==0.14.4
# via tlviz
tensorly==0.9.0
# via cellcommunicationpf2
threadpoolctl==3.5.0
# via scikit-learn
tlviz==0.1.1
# via cellcommunicationpf2
tqdm==4.66.5
# via cellcommunicationpf2
tzdata==2024.2
# via pandas
urllib3==2.2.3
# via requests
xarray==2024.9.0
# via tlviz

0 comments on commit daeda01

Please sign in to comment.