[ome-devel] Create a new table

William Moore (Staff) W.Moore at dundee.ac.uk
Mon Jun 4 09:57:21 BST 2018


Hi Etienne,

 This is probably due to missing in incomplete installation of PyTables dependencies on your server.

This should be included in the server install steps. For example, on CentOs 7 (https://docs.openmicroscopy.org/omero/5.4.6/sysadmins/unix/server-centos7-ice36.html)
we install PyTables on this line:

yum -y install python-{pip,devel,virtualenv,yaml,jinja2,tables}

If you have access to the server machine, you can test that PyTables are working with examples from:
https://www.pytables.org/usersguide/tutorials.html

E.g. this should work without errors:

$ python
>>> from tables import *
>>> class Particle(IsDescription):
...     name      = StringCol(16)
...
>>> h5file = open_file("tutorial1.h5", mode="w", title="Test file")
>>> group = h5file.create_group("/", 'detector', 'Detector information')
>>> table = h5file.create_table(group, 'readout', Particle, "Readout example")

Hope that helps you to track down the problem,

 Regards,

   Will.



On 29 May 2018, at 18:41, Etienne Dumoulin <etienne at phenomic.ai<mailto:etienne at phenomic.ai>> wrote:

Hi Omero developers,

I would like to create a new table. I followed exactly the steps given in the python documentation<https://docs.openmicroscopy.org/omero/5.4.6/developers/Python.html#omero-tables>. I use the current version of omero (5.4.6).

Here is the my minimal code snippet:
#############################################################
table_name = "myrandomname"
columns = [omero.grid.LongColumn('col1', 'col test', [1,2,3])]

resources = conn.c.sf.sharedResources()
repository_id = resources.repositories().descriptions[0].getId().getValue()
table = resources.newTable(repository_id, table_name)
table.initialize(columns)
table.addData(columns)
table.close()
#############################################################


AttributeError: 'NoneType' object has no attribute 'initialize'

The error is quite clear, resources.newTable returns None. However, I am not too sure what I should do to fix it.

Also it seems a record is created in the originalfile database table every time I run this code.

Thank you for your patience.

Regards,

Etienne


--
Etienne Dumoulin
PhenomicAI
Lead software engineer
+1 (416)-471-8323
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20180604/b19baef2/attachment.html>


More information about the ome-devel mailing list