Skip to content

Commit

Permalink
🐛 fix networkx conda deps
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed Jun 7, 2023
1 parent f9de7ed commit ee7cde4
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 31 deletions.
7 changes: 6 additions & 1 deletion cdlib/algorithms/internal/GDMP2_nx.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,12 @@ def GDMP2(graph, min_threshold=0.75):
x1 = adj_matrix[:, x]
for y in range(x, col):
y1 = adj_matrix[:, y]
M[x][y] = 1 - scipy.spatial.distance.cosine(x1, y1)
try:
M[x][y] = 1 - scipy.spatial.distance.cosine(x1, y1)
except ValueError:
x1 = np.ndarray(x1.flatten())[0]
y1 = np.ndarray(y1.flatten())[0]
M[x][y] = 1 - scipy.spatial.distance.cosine(x1, y1)

tuples = []
# On basis of zero graph
Expand Down
11 changes: 8 additions & 3 deletions cdlib/algorithms/internal/SiblinarityAntichain.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ def __init__(self, node_id_dict, similarity_matrix, Lambda, with_replacement):
self.similarity_matrix = similarity_matrix
self.node_id_dict = node_id_dict
self.strength = similarity_matrix.sum(axis=0)
self.strength = {
n: self.strength[node_id_dict[n]] for n in node_id_dict.keys()
} # sum over rows?
try:
self.strength = {
n: self.strength[node_id_dict[n]] for n in node_id_dict.keys()
} # sum over rows?
except IndexError:
self.strength = {
n: self.strength[0, node_id_dict[n]] for n in node_id_dict.keys()
}
self.total_weight = similarity_matrix.sum() # /2
self.Lambda = Lambda
self.with_replacement = with_replacement
Expand Down
6 changes: 0 additions & 6 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ requirements:
- python==3.9
- angel_cd
- bimlpa
# - chinese_whispers
- demon
- dynetx
- eva_lcd
# - karateclub
- leidenalg
- markov_clustering
- matplotlib
Expand All @@ -28,7 +26,6 @@ requirements:
- pip
- pooch
- pulp
# - pyclustering
- python-igraph
- python-levenshtein
- python-louvain
Expand All @@ -37,15 +34,13 @@ requirements:
- seaborn
- thresholdclustering
- tqdm
# - wurlitzer
- setuptools
build:
- python
- setuptools
run:
- angel_cd
- bimlpa
# - chinese_whispers
- demon
- dynetx
- eva_lcd
Expand All @@ -57,7 +52,6 @@ requirements:
- pandas
- pooch
- pulp
# - pyclustering
- python-igraph
- python-levenshtein
- python-louvain
Expand Down
20 changes: 10 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@ def __getattr__(cls, name):
master_doc = "index"

# General information about the project.
project = u"CDlib"
copyright = u"2019, Giulio Rossetti"
author = u"Giulio Rossetti"
project = "CDlib"
copyright = "2019, Giulio Rossetti"
author = "Giulio Rossetti"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = u"0.2.6"
version = "0.2.6"
# The full version, including alpha/beta/rc tags.
release = u"0.2.6"
release = "0.2.6"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -200,10 +200,10 @@ def __getattr__(cls, name):

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
html_title = u"CDlib - Community Discovery library"
html_title = "CDlib - Community Discovery library"

# A shorter title for the navigation bar. Default is the same as html_title.
html_short_title = u"CDlib"
html_short_title = "CDlib"

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
Expand Down Expand Up @@ -302,7 +302,7 @@ def __getattr__(cls, name):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "CDlib.tex", u"CDlib Documentation", u"Giulio Rossetti", "manual")
(master_doc, "CDlib.tex", "CDlib Documentation", "Giulio Rossetti", "manual")
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -330,7 +330,7 @@ def __getattr__(cls, name):

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "CDlib", u"CDlib Documentation", [author], 1)]
man_pages = [(master_doc, "CDlib", "CDlib Documentation", [author], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -345,7 +345,7 @@ def __getattr__(cls, name):
(
master_doc,
"CDlib",
u"CDlib Documentation",
"CDlib Documentation",
author,
"CDlib",
"Community Discovery Library",
Expand Down
5 changes: 1 addition & 4 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: cdlib
dependencies:
- python=3.9
#- graph-tool # ==2.44
- numpy
- matplotlib
- scikit-learn
- tqdm
- networkx
- networkx>=3.0
- demon
- python-louvain
- nf1
Expand All @@ -17,11 +16,9 @@ dependencies:
- eva_lcd
- bimlpa
- markov_clustering
# - chinese_whispers
- python-igraph
- angel_cd
- pooch
- dynetx
- thresholdclustering
#- pyclustering
- python-Levenshtein
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
numpy
future
matplotlib
scikit-learn
scikit - learn
tqdm
networkx>=3.0
networkx >= 3.0
demon
python-louvain>=0.16
python - louvain >= 0.16
nf1
scipy
pulp
Expand All @@ -15,12 +15,12 @@ eva_lcd
bimlpa
markov_clustering
# chinese_whispers
python-igraph>=0.10
angel-cd
python - igraph >= 0.10
angel - cd
pooch
dynetx
thresholdclustering
pyclustering
cython
python-Levenshtein
bayanpy
python - Levenshtein
bayanpy

0 comments on commit ee7cde4

Please sign in to comment.