Skip to content

Commit

Permalink
Merge pull request #23 from joshmoore/53compatible
Browse files Browse the repository at this point in the history
test omero53 in travis
  • Loading branch information
joshmoore authored Dec 5, 2017
2 parents 964bf8e + b7f3189 commit f986bd1
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 203 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.pyc
.DS_Store
.*un~
.omero
.DS_Store
6 changes: 6 additions & 0 deletions .omeroci/app-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -e
set -u
OMERO_VENV=${OMERO_VENT:-/opt/omero/web/venv}
OMERO_DIST=${OMERO_DIST:-/opt/omero/web/OMERO.web}
${OMERO_VENV}/bin/python \
$OMERO_DIST/bin/omero config append omero.web.apps '"omero_mapr"'
19 changes: 2 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,8 @@ python:
services:
- docker

env:
- OMEROBUILD=OMERO-DEV-merge-build

before_install:
- docker --version
- pip install docker-compose
- docker-compose -v

before_script:
- pip install flake8 pycodestyle pep8-naming
- flake8 --version
- flake8 -v .
- python setup.py sdist install
- git clone git://github.com/openmicroscopy/omero-test-infra .omero

script:
- echo 'Tested in CI'
# - docker-compose -f docker/docker-compose.yml up --build --abort-on-container-exit
# - exitcode=$(docker inspect -f '{{.State.ExitCode}}' docker_maprtest_1)
# - docker-compose -f docker/docker-compose.yml rm -fv
# - exit $exitcode
- .omero/app-docker
30 changes: 0 additions & 30 deletions docker/docker-compose.yml

This file was deleted.

2 changes: 1 addition & 1 deletion omero_mapr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from omero_mapr.utils.version import get_version


VERSION = (0, 1, 14)
VERSION = (0, 2, 0)

__version__ = get_version(VERSION)

Expand Down
16 changes: 8 additions & 8 deletions omero_mapr/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _find_first_selected(self):
self.conn.SERVICE_OPTS.setOmeroGroup('-1')
first_selected = self._load_first_selected(
first_obj, attributes)
except:
except Exception:
pass
if first_obj not in self.TOP_LEVEL_PREFIXES:
# Need to see if first item has parents
Expand Down Expand Up @@ -268,7 +268,7 @@ def mapr_paths_to_object(conn, mapann_value,
# Experimenter is always present
try:
experimenter_id = e[0]["owner"]
except:
except Exception:
experimenter_id = -1
path.append({
'type': 'experimenter',
Expand All @@ -281,7 +281,7 @@ def mapr_paths_to_object(conn, mapann_value,
'type': 'map',
'id': map_value,
})
except:
except Exception:
pass

try:
Expand All @@ -290,7 +290,7 @@ def mapr_paths_to_object(conn, mapann_value,
'type': 'screen',
'id': e[0]["screen_id"]
})
except:
except Exception:
pass

try:
Expand All @@ -300,7 +300,7 @@ def mapr_paths_to_object(conn, mapann_value,
'type': 'plate',
'id': plate_id,
})
except:
except Exception:
pass

try:
Expand All @@ -309,7 +309,7 @@ def mapr_paths_to_object(conn, mapann_value,
'type': 'project',
'id': e[0]["project_id"]
})
except:
except Exception:
pass

try:
Expand All @@ -318,7 +318,7 @@ def mapr_paths_to_object(conn, mapann_value,
'type': 'dataset',
'id': e[0]["dataset_id"],
})
except:
except Exception:
pass

# Image is always present
Expand All @@ -327,7 +327,7 @@ def mapr_paths_to_object(conn, mapann_value,
'type': 'image',
'id': e[0]["image_id"]
})
except:
except Exception:
pass
paths.append(path)
return paths
23 changes: 3 additions & 20 deletions omero_mapr/testlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from omero.constants.namespaces import NSBULKANNOTATIONS
from omero.util.populate_metadata import BulkToMapAnnotationContext
from omero.util.populate_metadata import ParsingContext
from omero.util.temp_files import create_path

from omeroweb.testlib import IWebTest

Expand All @@ -39,22 +38,6 @@ class IMaprTest(IWebTest):
Extends IWebTest (ITest)
"""

def create_csv(
self,
col_names="Well,Well Type,Concentration",
row_data=("A1,Control,0", "A2,Treatment,10")
):

csv_file_name = create_path("test", ".csv")
csv_file = open(csv_file_name, 'w')
try:
csv_file.write(col_names)
csv_file.write("\n")
csv_file.write("\n".join(row_data))
finally:
csv_file.close()
return str(csv_file_name)

def set_name(self, obj, name):
q = self.client.sf.getQueryService()
up = self.client.sf.getUpdateService()
Expand All @@ -68,8 +51,8 @@ def create_screen(self, row_count, col_count):
plate = self.importPlates(plateRows=row_count,
plateCols=col_count)[0]
except AttributeError:
plate = self.import_plates(plateRows=row_count,
plateCols=col_count)[0]
plate = self.import_plates(plate_rows=row_count,
plate_cols=col_count)[0]
plate = self.set_name(plate, "Plate001")
screen = ScreenI()
screen.name = rstring("Screen001")
Expand Down Expand Up @@ -125,6 +108,6 @@ def populate_data(self, csv, cfg):
fileid = table_file_ann.file.id.val

ctx = BulkToMapAnnotationContext(
self.client, self.screen.proxy(), fileid=fileid, cfg=cfg)
self.client, self.screen.proxy(), fileid=fileid, cfg=cfg)
ctx.parse()
ctx.write_to_omero()
2 changes: 1 addition & 1 deletion omero_mapr/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
except ImportError:
try:
import Image # see ticket:2597
except:
except ImportError:
logger.error(
"You need to install the Python Imaging Library. Get it at"
" http://www.pythonware.com/products/pil/")
Expand Down
42 changes: 0 additions & 42 deletions runtest

This file was deleted.

6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def pytest_configure():
"config": {
"default": ["Gene Symbol"],
"all": ["Gene Symbol", "Gene Identifier"],
"ns": ["openmicroscopy.org/omero/bulk_annotations"],
"ns": ["openmicroscopy.org/mapr/gene"],
"label": "Gene",
"case_sensitive": True,
}
Expand All @@ -58,7 +58,7 @@ def pytest_configure():
"config": {
"default": ["Phenotype"],
"all": ["Phenotype", "Phenotype Term Accession"],
"ns": ["openmicroscopy.org/omero/bulk_annotations"],
"ns": ["openmicroscopy.org/mapr/phenotype"],
"label": "Phenotype",
}
},
Expand All @@ -67,7 +67,7 @@ def pytest_configure():
"config": {
"default": ["Organism"],
"all": ["Organism"],
"ns": ["openmicroscopy.org/omero/bulk_annotations"],
"ns": ["openmicroscopy.org/mapr/organism"],
"label": "Organism",
}
},
Expand Down
42 changes: 31 additions & 11 deletions tests/integration/bulk_to_map_annotation_context.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Screen001
version: 1
version: 2

defaults:
# Should the column be processed when creating bulk-annotations (yes/no)
Expand All @@ -21,19 +21,39 @@ defaults:

columns:

- name: Organism
- name: Channels
include: yes

- name: Gene Identifier
include: yes
- name: Gene Identifier
clientname: Gene Identifier URL
clientvalue: http://www.ebi.ac.uk/cmpo/{{ value|urlencode }}
include: yes
- name: Gene Symbol
include: yes
- group:
namespace: openmicroscopy.org/mapr/gene
columns:
- name: Gene Identifier
include: yes
- name: Gene Identifier
clientname: Gene Identifier URL
clientvalue: http://www.pombase.org/spombe/result/{{ value|urlencode }}
include: yes
- name: Gene Symbol
include: yes

- group:
namespace: openmicroscopy.org/mapr/organism
columns:
- name: Organism
include: yes

advanced:
# If a map-annotation is attached to a well also attach it to all images
# in the well
well_to_images: yes
well_to_images: yes

# TODO: Primary key config should be in a global config
ignore_missing_primary_key: yes
primary_group_keys:
- namespace: openmicroscopy.org/mapr/gene
keys:
- Gene Identifier
- Gene Symbol
- namespace: openmicroscopy.org/mapr/organism
keys:
- Organism
Loading

0 comments on commit f986bd1

Please sign in to comment.