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

Remove Publication Title from description in study_parser.py #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

will-moore
Copy link
Member

See ome/omero-mapr#74 (comment)

We want to simplify the Study description so that it can be parsed for searching, without duplicating the Study Title in the description.

if "Type" in component:
key = "%s Description" % component["Type"]
else:
key = "Study Description"
component_title = (
"%s\n%s" % (key, component[key]))
component_title = component[key]
if "Study Version History" in component:
history = ("\n\nVersion History\n%s" %
Copy link
Member

Choose a reason for hiding this comment

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

If we are looking into removing publication title from the description, a question is whether this heading should be kept at all for the relevant studies or if the value of this field should be more simply appended with 1-2 newlines

Copy link
Member Author

Choose a reason for hiding this comment

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

by "this heading" do you mean "Study Version History"? I'm happy to remove that heading too if it's not needed?

Copy link
Member

Choose a reason for hiding this comment

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

yes, I meant Study Version History but deferring to you, @khaledk2 and @francesw on what makes the most sense both in terms of UI and searchability.

@will-moore
Copy link
Member Author

We want to run this on all studies...

for dir in */ ; do
  cd "$dir"
  
  # Check for a file ending with study.txt
  if [ -e *study.txt ]; then
    python /idr-utils/pyidr/study_parser.py $(find . -type f -name '*study.txt') --set
  fi
  
  cd ..
done

@sbesson
Copy link
Member

sbesson commented Apr 19, 2023

As a one-liner I have been using the following in the past to update all descriptions/annotations of the top-level containers:

source /opt/omero/server/venv3/bin/activate
cd /uod/idr/metadata/
find . -maxdepth 2 -type f -iname *study.txt -exec python idr-utils/pyidr/study_parser.py --set {} \;

@will-moore
Copy link
Member Author

Trying to pull this branch onto pilot-idr0125 for testing, but can't connect to github...

$ ssh -A -o 'ProxyCommand ssh idr-pilot.openmicroscopy.org -W %h:%p' idr0125-omeroreadwrite -L 1080:localhost:80

$ cd /uod/idr/metadata/idr-utils
$ git remote -v
origin	https://github.com/IDR/idr-utils (fetch)
origin	https://github.com/IDR/idr-utils (push)
sbesson	git://github.com/sbesson/idr-utils (fetch)
sbesson	git://github.com/sbesson/idr-utils (push)

$ sudo -Es git remote add will git://github.com/will-moore/idr-utils
$ sudo -Es git fetch will
fatal: unable to connect to github.com:
github.com[0: 140.82.121.4]: errno=Connection timed out

@sbesson
Copy link
Member

sbesson commented Apr 19, 2023

The git:// protocol is deprecated. Do you have the same error with HTTPs?

@will-moore
Copy link
Member Author

That worked, thanks!

sudo -Es git remote set-url will https://github.com/will-moore/idr-utils
sudo -Es git fetch will
 * [new branch]      study_description_no_title -> will/study_description_no_title
sudo -Es git checkout will/study_description_no_title

@will-moore
Copy link
Member Author

source /opt/omero/server/venv3/bin/activate
cd /uod/idr/metadata/
omero login
find . -maxdepth 2 -type f -iname *study.txt -exec python idr-utils/pyidr/study_parser.py --set {} \;

@will-moore
Copy link
Member Author

Also just ran the study_parser as above on idr-testing to update descriptions.

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

Successfully merging this pull request may close these issues.

2 participants