re-import sources as agreed with the maintainer

This commit is contained in:
Adam Samalik 2023-07-11 11:27:44 +02:00
parent 00a993e8d1
commit d668cc4be0
7 changed files with 173 additions and 1 deletions

6
.gitignore vendored
View File

@ -1,2 +1,6 @@
SOURCES/networkx-1.11.tar.gz
/networkx_reference.pdf
/networkx_tutorial.pdf
/networkx-documentation.zip
/networkx-1.9.1.tar.gz
/networkx-1.10.tar.gz
/networkx-1.11.tar.gz

20
networkx-numpy.patch Normal file
View File

@ -0,0 +1,20 @@
With recent versions of numpy, the original expression results in:
TypeError: Cannot cast ufunc add output from dtype('float64') to dtype('int64')
with casting rule 'same_kind'
This patch solves the issue by not trying to add in place.
diff -Naur networkx-networkx-1.10.orig/networkx/linalg/algebraicconnectivity.py networkx-networkx-1.10/networkx/linalg/algebraicconnectivity.py
--- networkx-networkx-1.10.orig/networkx/linalg/algebraicconnectivity.py 2015-10-30 15:41:35.000000000 -0600
+++ networkx-networkx-1.10/networkx/linalg/algebraicconnectivity.py 2015-12-01 09:49:51.568953316 -0700
@@ -244,8 +244,7 @@
W -= (W.T * X * X.T).T
project(W)
# Compute the diagonal of P * L * P as a Jacobi preconditioner.
- D = L.diagonal()
- D += 2. * (asarray(X) * asarray(W)).sum(axis=1)
+ D = L.diagonal() + 2. * (asarray(X) * asarray(W)).sum(axis=1)
D += (asarray(X) * asarray(X * (W.T * X))).sum(axis=1)
D[D < tol * Lnorm] = 1.
D = 1. / D

63
tests/examples/Makefile Normal file
View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /examples
# Description: Run some of the examples from upstream sources
# Author: Petr Lautrbach <plautrba@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/examples
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE tests.list
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Petr Lautrbach <plautrba@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Run some of the examples from upstream sources" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 30m" >> $(METADATA)
@echo "RunFor: examples" >> $(METADATA)
@echo "Requires: examples" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL4 -RHELClient5 -RHELServer5 -RHELServer6 -RHELServer7" >> $(METADATA)
rhts-lint $(METADATA)

3
tests/examples/PURPOSE Normal file
View File

@ -0,0 +1,3 @@
PURPOSE of /examples
Description: Run some of the examples from upstream sources
Author: Petr Lautrbach <plautrba@redhat.com>

51
tests/examples/runtest.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /examples
# Description: Run some of the examples from upstream sources
# Author: Petr Lautrbach <plautrba@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="python3-networkx"
EXAMPLES="/usr/share/doc/python3-networkx-core/examples"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlPhaseEnd
for test in `cat tests.list`; do
rlPhaseStartTest $test
dir=${test/\/*/}
script=${test/*\//}
cd $EXAMPLES/$dir
rlRun "python3 $script" 0
cd -
rlPhaseEnd
done
rlJournalPrintText
rlJournalEnd

19
tests/examples/tests.list Normal file
View File

@ -0,0 +1,19 @@
advanced/heavy_metal_umlaut.py
advanced/iterated_dynamical_systems.py
advanced/parallel_betweenness.py
algorithms/davis_club.py
algorithms/krackhardt_centrality.py
algorithms/rcm.py
basic/properties.py
basic/read_write.py
drawing/chess_masters.py
drawing/knuth_miles.py
graph/degree_sequence.py
graph/erdos_renyi.py
graph/expected_degree_sequence.py
graph/karate_club.py
graph/knuth_miles.py
graph/napoleon_russian_campaign.py
graph/roget.py
graph/words.py
multigraph/chess_masters.py

12
tests/tests.yml Normal file
View File

@ -0,0 +1,12 @@
- hosts: localhost
tags:
- classic
- container
roles:
- role: standard-test-source
- role: standard-test-beakerlib
required_packages:
- python3-networkx
tests:
- examples