Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ale
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aflab
astrogeology
Ale
Commits
feaa82b4
Commit
feaa82b4
authored
Jan 29, 2019
by
Adam Paquette
Browse files
Options
Downloads
Patches
Plain Diff
Updated some python documentation
parent
24887420
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ale/drivers/__init__.py
+6
-1
6 additions, 1 deletion
ale/drivers/__init__.py
ale/drivers/base.py
+25
-1
25 additions, 1 deletion
ale/drivers/base.py
with
31 additions
and
2 deletions
ale/drivers/__init__.py
+
6
−
1
View file @
feaa82b4
...
...
@@ -21,7 +21,12 @@ drivers = dict(chain.from_iterable(inspect.getmembers(dmod, lambda x: inspect.is
def
load
(
label
):
"""
Load label from
Attempt to load a given label from all possible drivers
Parameters
----------
label : str
String path to the given label file
"""
for
name
,
driver
in
drivers
.
items
():
try
:
...
...
This diff is collapsed.
Click to expand it.
ale/drivers/base.py
+
25
−
1
View file @
feaa82b4
...
...
@@ -22,9 +22,25 @@ class Driver():
self
.
_file
=
file
def
__str__
(
self
):
"""
Returns a string representation of the class
Returns
-------
str
String representation of all attributes and methods of the class
"""
return
str
(
self
.
to_dict
())
def
is_valid
(
self
):
"""
Checks if the driver has an intrument id associated with it
Returns
-------
bool
True if an instrument_id is defined, False otherwise
"""
try
:
iid
=
self
.
instrument_id
return
True
...
...
@@ -32,10 +48,18 @@ class Driver():
return
False
def
to_dict
(
self
):
"""
Generates a dictionary of keys based on the attributes and methods assocated with
the driver and the required keys for the driver
Returns
-------
dict
Dictionary of key, attribute pairs
"""
keys
=
set
(
dir
(
self
))
&
self
.
required_keys
return
{
p
:
getattr
(
self
,
p
)
for
p
in
keys
}
class
LineScanner
(
Driver
):
@property
def
name_model
(
self
):
...
...
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