1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
Description: make documentation build reproducible
Some parts of the source involve some nondeterminism or build-time
variation when converted to the documentation via epydoc, making
the build unreproducible.
The first issue is the fact that sets of classes (types) cannot be sorted
deterministically when converted to lists -- Python 2 uses addresses
as keys, in Python 3 types are unorderable. This patch uses a list instead
of a set, which is OK here as the original set contents are expliitly defined,
constant and small. This is not a bug to be fixed in epydoc as IMHO it's
already handled as well as possible in epydoc itself, so I had to work
around the issue here in python-csb; if it can't be sorted that's it.
Secondly, function default parameters are included in the documentation,
which in the case of runmany() contains the number of CPUs in the build host.
This patch moves this default assignment out of the function header into the
body, from where it's not included in the documentation.
Author: Sascha Steinbiss <sascha@steinbiss.name>
--- a/csb/bio/sequence/__init__.py
+++ b/csb/bio/sequence/__init__.py
@@ -130,7 +130,7 @@
SequenceTypes.RNA: NucleicAlphabet,
SequenceTypes.Unknown: UnknownAlphabet }
- ALL_ALPHABETS = set([ProteinAlphabet, NucleicAlphabet, UnknownAlphabet])
+ ALL_ALPHABETS = [ProteinAlphabet, NucleicAlphabet, UnknownAlphabet]
assert set(MAP) == csb.core.Enum.members(SequenceTypes)
@@ -1329,4 +1329,4 @@
from csb.bio.io.fasta import SequenceAlignmentReader
return SequenceAlignmentReader(strict=strict).read_a3m(string)
-
\ No newline at end of file
+
--- a/csb/apps/hhsearch.py
+++ b/csb/apps/hhsearch.py
@@ -252,8 +252,11 @@
context.result = self.parser.parse_file(o.name)
return context
- def runmany(self, contexts, workers=mp.cpu_count(), cpu=1):
-
+ def runmany(self, contexts, workers, cpu=1):
+
+ if not workers:
+ workers = mp.cpu_count()
+
if workers > len(contexts):
workers = len(contexts)
@@ -278,4 +281,4 @@
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
|