forked from ome/openmicroscopy
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flake8 remaining examples Python files
- Loading branch information
Showing
14 changed files
with
87 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import omero | ||
import omero_Tables_ice | ||
import omero_SharedResources_ice | ||
|
||
c = omero.client() | ||
s = c.createSession() | ||
r = s.sharedResources() | ||
m = r.repositories() | ||
i = m.descriptions[0].id.val | ||
t = r.newTable(i, "/example.h5") | ||
l = omero.grid.LongColumn('name','desc',None) | ||
l = omero.grid.LongColumn('name', 'desc', None) | ||
t.initialize([l]) | ||
l.values = [1,2,3,4] | ||
l.values = [1, 2, 3, 4] | ||
t.addData([l]) | ||
ids = t.getWhereList('(name==1)',{},0,0,0) | ||
ids = t.getWhereList('(name==1)', {}, 0, 0, 0) | ||
data = t.readCoordinates(ids) | ||
print data.columns[0].values[0] | ||
data = t.slice([0],[0]) | ||
data = t.slice([0], [0]) | ||
print data.columns[0].values[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,46 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import omero | ||
from omero_sys_ParametersI import ParametersI # Temporary | ||
from omero_sys_ParametersI import ParametersI # Temporary | ||
|
||
c = omero.client(); | ||
s = c.createSession(); | ||
q = s.getQueryService(); | ||
c = omero.client() | ||
s = c.createSession() | ||
q = s.getQueryService() | ||
|
||
QUERY = 'select p from Plate p left outer join fetch p.wells w left outer join fetch w.wellSamples s left outer join fetch s.image where p.id = :id'; | ||
QUERY = ("select p from Plate p left outer join fetch p.wells w" | ||
" left outer join fetch w.wellSamples s" | ||
" left outer join fetch s.image where p.id = :id") | ||
|
||
filter = omero.sys.Filter(); | ||
plates = q.findAll('Plate', filter); | ||
filter = omero.sys.Filter() | ||
plates = q.findAll('Plate', filter) | ||
|
||
|
||
print 'Plate:' | ||
for i in range(len(plates)): | ||
params = ParametersI(); | ||
params.addId(plates[i].getId().getValue()); | ||
plate = q.findByQuery(QUERY, params); | ||
print ' %d %s ' % ( i, plate.getName().getValue() ) | ||
params = ParametersI() | ||
params.addId(plates[i].getId().getValue()) | ||
plate = q.findByQuery(QUERY, params) | ||
print ' %d %s ' % (i, plate.getName().getValue()) | ||
wells = {} | ||
|
||
for well in plate.copyWells(): | ||
row = well.getRow() and well.getRow().getValue() or -1 | ||
col = well.getColumn() and well.getColumn().getValue() or -1 | ||
if row in wells: | ||
row_list = wells[row]; | ||
row_list = wells[row] | ||
else: | ||
row_list = [] | ||
wells[row] = row_list; | ||
row_list.append(col); | ||
wells[row] = row_list | ||
row_list.append(col) | ||
row_list.sort() | ||
|
||
rows = list(wells.keys()); | ||
rows = list(wells.keys()) | ||
rows.sort() | ||
|
||
for row in rows: | ||
msg = ' '; | ||
col_list = list(wells[row]); | ||
msg = ' ' | ||
col_list = list(wells[row]) | ||
col_list.sort() | ||
for col in col_list: | ||
msg += '%2dx%2d ' % (row, col); | ||
msg += '%2dx%2d ' % (row, col) | ||
print msg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import omero | ||
from omero.rtypes import * | ||
|
||
from omero.rtypes import rstring | ||
from omero_sys_ParametersI import ParametersI | ||
|
||
|
||
def getProjects(query_prx, username): | ||
return query_prx.findAllByQuery( | ||
"select p from Project p join fetch p.datasetLinks dil join fetch dil.child where p.details.owner.omeName = :name", | ||
ParametersI().add("name", rstring(username))) | ||
"select p from Project p" | ||
" join fetch p.datasetLinks dil" | ||
" join fetch dil.child" | ||
" where p.details.owner.omeName = :name", | ||
ParametersI().add("name", rstring(username))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
import sys | ||
|
||
|
||
def usage(): | ||
print"TreeList.Main host port username password" | ||
sys.exit(-2) |