Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyHMMER
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Larralde
PyHMMER
Commits
480b7fb8
Commit
480b7fb8
authored
5 months ago
by
Martin Larralde
Browse files
Options
Downloads
Patches
Plain Diff
Make `MSAFile` generic over the `MSA` type based on `digital` flag
parent
f7a37a3b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyhmmer/easel.pyi
+20
-8
20 additions, 8 deletions
pyhmmer/easel.pyi
with
20 additions
and
8 deletions
pyhmmer/easel.pyi
+
20
−
8
View file @
480b7fb8
...
...
@@ -442,27 +442,39 @@ class DigitalMSA(MSA):
# --- MSA File ---------------------------------------------------------------
class
MSAFile
(
typing
.
ContextManager
[
MSAFile
],
typing
.
Iterator
[
MSA
]):
M
=
typing
.
TypeVar
(
"
M
"
,
TextMSA
,
DigitalMSA
)
class
MSAFile
(
typing
.
Generic
[
M
],
typing
.
ContextManager
[
MSAFile
[
M
]],
typing
.
Iterator
[
M
]):
_FORMATS
:
typing
.
ClassVar
[
typing
.
Dict
[
str
,
int
]]
alphabet
:
typing
.
Optional
[
Alphabet
]
name
:
typing
.
Optional
[
str
]
@typing.overload
def
__init__
(
self
,
self
:
MSAFile
[
DigitalMSA
],
file
:
typing
.
Union
[
typing
.
AnyStr
,
os
.
PathLike
[
typing
.
AnyStr
],
typing
.
BinaryIO
],
format
:
typing
.
Optional
[
str
]
=
None
,
*
,
digital
:
Literal
[
True
],
alphabet
:
typing
.
Optional
[
Alphabet
]
=
None
,
)
->
None
:
...
@typing.overload
def
__init__
(
self
:
MSAFile
[
TextMSA
],
file
:
typing
.
Union
[
typing
.
AnyStr
,
os
.
PathLike
[
typing
.
AnyStr
],
typing
.
BinaryIO
],
format
:
typing
.
Optional
[
str
]
=
None
,
*
,
digital
:
bool
=
False
,
digital
:
Literal
[
False
]
=
False
,
alphabet
:
typing
.
Optional
[
Alphabet
]
=
None
,
)
->
None
:
...
def
__enter__
(
self
)
->
MSAFile
:
...
def
__enter__
(
self
)
->
MSAFile
[
M
]
:
...
def
__exit__
(
self
,
exc_type
:
typing
.
Optional
[
typing
.
Type
[
BaseException
]],
exc_value
:
typing
.
Optional
[
BaseException
],
traceback
:
typing
.
Optional
[
types
.
TracebackType
],
)
->
bool
:
...
def
__iter__
(
self
)
->
MSAFile
:
...
def
__next__
(
self
)
->
M
SA
:
...
def
__iter__
(
self
)
->
MSAFile
[
M
]
:
...
def
__next__
(
self
)
->
M
:
...
def
__repr__
(
self
)
->
str
:
...
@property
def
closed
(
self
)
->
bool
:
...
...
...
@@ -470,7 +482,7 @@ class MSAFile(typing.ContextManager[MSAFile], typing.Iterator[MSA]):
def
digital
(
self
)
->
bool
:
...
@property
def
format
(
self
)
->
str
:
...
def
read
(
self
)
->
typing
.
Optional
[
M
SA
]:
...
def
read
(
self
)
->
typing
.
Optional
[
M
]:
...
def
close
(
self
)
->
None
:
...
# --- Randomness -------------------------------------------------------------
...
...
@@ -585,7 +597,7 @@ class DigitalSequence(Sequence):
S
=
typing
.
TypeVar
(
"
S
"
,
TextSequence
,
DigitalSequence
)
B
=
typing
.
TypeVar
(
"
B
"
,
SequenceBlock
[
TextSequence
],
SequenceBlock
[
DigitalSequence
])
class
SequenceBlock
(
typing
.
MutableSequence
[
S
],
typing
.
Generic
[
S
]):
class
SequenceBlock
(
typing
.
Generic
[
S
],
typing
.
MutableSequence
[
S
]):
def
__len__
(
self
)
->
int
:
...
@typing.overload
def
__getitem__
(
self
,
index
:
int
)
->
S
:
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment