forked from ome/omero_search_engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into modify_unit_test_validation
- Loading branch information
Showing
22 changed files
with
549 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: all | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" |
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
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,2 +1,20 @@ | ||
Developer's documents | ||
===================== | ||
===================== | ||
|
||
The developer should clone the code from the project repo using the following command:: | ||
|
||
git clone https://github.com/ome/omero_search_engine.git | ||
|
||
Then they need to create a Python virtual environment variable using either venv or conda and install the packages inside requirements.txt | ||
|
||
The developer needs to set up the application configuration as it is explained in the System configuration part inside "docs\configuration\configuration_installation.rst" | ||
|
||
After that, they should run the indexer to index Omero's data using the following command:: | ||
|
||
python manage.py get_index_data_from_database | ||
|
||
The developer can run the application using the following command:: | ||
|
||
python manage.py runserver -p 5577 | ||
|
||
Running the scripts inside the examples folder can be a good starting point. |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright (C) 2023 University of Dundee & Open Microscopy Environment. | ||
# All rights reserved. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from utils import base_url | ||
import requests | ||
import json | ||
import logging | ||
|
||
""" | ||
Return the available keys in a containers | ||
Also get the aviable values for a key """ | ||
|
||
resource = "image" | ||
container_name = "idr0034" | ||
key = "cell line" | ||
|
||
# the following url will return the existing key in this container | ||
keys_url = ( | ||
"{base_url}resources/image/container_keys/?container_name={container_name}".format( | ||
base_url=base_url, container_name=container_name | ||
) | ||
) | ||
|
||
resp = requests.get(url=keys_url) | ||
keys_results = json.loads(resp.text) | ||
for result in keys_results: | ||
logging.info("%s: %s" % (result.get("type"), result.get("name"))) | ||
for bucket in result.get("results"): | ||
logging.info( | ||
"Key: %s, no of images: %s " % (bucket.get("key"), bucket.get("no_image")) | ||
) | ||
|
||
""" It is possible to get all the available | ||
values for a key | ||
""" | ||
values_key_url = ( | ||
"{base_url}resources/image/" | ||
"container_keyvalues/?container_name={container_name}&key={key}".format( | ||
base_url=base_url, container_name=container_name, key=key | ||
) | ||
) | ||
|
||
resp = requests.get(url=values_key_url) | ||
|
||
key_values_results = json.loads(resp.text) | ||
|
||
for result in key_values_results: | ||
logging.info("%s: %s" % (result.get("type"), result.get("name"))) | ||
for bucket in result.get("results"): | ||
logging.info( | ||
"Key: %s, value: %s, no of images: %s " | ||
% (bucket.get("key"), bucket.get("value"), bucket.get("no_image")) | ||
) |
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
Oops, something went wrong.