Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete and create bulk-map-annotations by namespace #5074

Merged
merged 22 commits into from
Feb 8, 2017

Conversation

manics
Copy link
Member

@manics manics commented Feb 1, 2017

What this PR does

Adds infrastructure and tests for creating and deleting bulk-map-annotations with a namespace limit. At the moment I've added an extensible way of passing additional parameters, but I haven't added a dedicated CLI flag.

--depends-on #5068

Todo:

  • Check if a73689b works as expected

Testing this PR

Run the integration tests

Run omero metadata populate ... --localcfg <cfg> where <cfg> is something that can be read by omero.utils.pydict_text_utils. For example, to limit by namespace any of the following should work:

--localcfg localcfg.yml or --localcfg OriginalFile:123:

ns: openmicroscopy/mapr/gene

--localcfg localcfg.json or --localcfg OriginalFile:123:

{
  "ns": "openmicroscopy/mapr/gene"
}

--localcfg '{"ns":"openmicroscopy/mapr/gene"}'

Related reading

@@ -59,6 +59,8 @@
from pytest import mark
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

./components/tools/OmeroPy/test/integration/metadata/test_populate.py:58:1: F401 'skip' imported but unused

@atarkowska
Copy link
Member

could you please fix travis? I will test it tomorrow then


log.info("Total: %d MapAnnotation(s) in %s",
len(set(self.mapannids)), nss)
log.info("Total: [%s] MapAnnotationLink(s) in %s", self.mapannids, nss)
Copy link
Member

@atarkowska atarkowska Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO:omero.util.populate_metadata:Total: [{'Image'... 8385632L])}] MapAnnotationLink(s) in [u'openmicroscopy.org/mapr/gene']

could this say also size please?
maybe size in info and actual dict in --report?

@@ -1605,10 +1631,14 @@ def _write_to_omero_batch(self, to_delete, loops=10, ms=500):
# an exception has been thrown (likely LockTimeout)
rsp = callback.getResponse()
if isinstance(rsp, omero.cmd.OK):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may never reach the logger because:

rsp <class 'omero.cmd.Delete2Response'> object #0 (::omero::cmd::Delete2Response)
{   
    deletedObjects =
    {   
        key = ome.model.annotations.WellAnnotationLink
        value =
        {   
            [0] = 8371438
        }
    }
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@atarkowska atarkowska Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the problem is in

ndal = len(rsp.deletedObjects.get(
     "ome.model.annotations.AnnotationLink", []))

there is no ome.model.annotations.AnnotationLink

@atarkowska
Copy link
Member

atarkowska commented Feb 3, 2017

Tested with snoopycrimecop/idr-metadata@5978294

diff after upgrade

   id    |        name         |                    value                    
---------+---------------------+---------------------------------------------
 6777389 | Gene Identifier     | FBgn0026361
 6777389 | Gene Identifier URL | http://flybase.org/reports/FBgn0026361.html
 6777389 | Gene Symbol         | Sep-05
 6784588 | Gene Identifier     | FBgn0014029
 6784588 | Gene Identifier URL | http://flybase.org/reports/FBgn0014029.html
 6784588 | Gene Symbol         | Sep-02
 6787011 | Gene Identifier     | FBgn0259923
 6787011 | Gene Identifier URL | http://flybase.org/reports/FBgn0259923.html
 6787011 | Gene Symbol         | Sep-04
 6796010 | Gene Identifier     | FBgn0000427
 6796010 | Gene Identifier URL | http://flybase.org/reports/FBgn0000427.html
 6796010 | Gene Symbol         | Dec-01
 6805811 | Gene Identifier     | FBgn0011710
 6805811 | Gene Identifier URL | http://flybase.org/reports/FBgn0011710.html
 6805811 | Gene Symbol         | Sep-01
(15 rows)

to be deleted manually otherwise mapr will pick them up in metadata panel.

@mtbc
Copy link
Member

mtbc commented Feb 6, 2017

FYI if it helps with testing the latest commits, in logback.xml if you bump omero.cmd.graphs up to DEBUG then Blitz-0.log will note everything that was deleted by Delete2.

@joshmoore
Copy link
Member

Now run on demo33 (next production). The performance issue will be addressed in follow-ups.

@atarkowska
Copy link
Member

--rebased-to #5246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants