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

Inconsistent env_broad_scale column #77

Open
Tracked by #587
jeaniceangelica opened this issue Apr 28, 2022 · 4 comments
Open
Tracked by #587

Inconsistent env_broad_scale column #77

jeaniceangelica opened this issue Apr 28, 2022 · 4 comments

Comments

@jeaniceangelica
Copy link
Collaborator

problem: env_broad_scale column in database has been used inconsistently
fixing env_broad_scale by merging the column with the ontology sql, so we're making the format to become
{term_label} {[term_id]}, where [term_id] starts with ENVO: and then has a 7 or 8 digit number

@turbomam
Copy link
Member

Here's how I tried to use this script:

  • I had an existing clone of this repo on my computer, so I just cd'ed there in my terminal
  • I did git fetch to get an index (but not the contents) of the latest stuff in every branch of this repo
  • I did git branch -a to see if there were any new branches, and saw issue-77-env_broad_scale
  • I could also see what was going on by checking the pull requests page which had a link to a recent PR, number inconsistent env_broad_scale #77 #78 from @jeaniceangelica entitled "inconsistent env_broad_scale #77" (I guess including the issue number in the PR might be confusing, but that's a practice I personally like.
  • I did git pull to make sure I had the latest. I wasn't really required in this case but I don't think excessive pulls ever hurt.

@turbomam
Copy link
Member

The previous comment addresses steps that are general to GitHub or most git-based collaboration platforms.

This is specific to our sample-annotator repository: I made sure the repository dependencies were loaded into a working environment by running poetry install. That also assumes that you already have the poetry application installed.

There are lots of ways to manage dependencies and environments, but when you work collaboratively, you have to use what the group is already using, or try to convince you colleagues to switch to soemthing else.

Poetry eliminates a lot of manual management tasks, but it does add one one idiosyncrasy: if you want to run soemthing inside of your poetry enviroment, you have to prepend your command with poetry run. So, assuming @jeaniceangelica's new script sample_annotator/non_edge.py could be run as python sample_annotator/non_edge.py in a standalone sense, I'm going to sun it with poetry run python sample_annotator/non_edge.py

@turbomam
Copy link
Member

Here's the response I got:

% poetry run python sample_annotator/non_edge.py
/usr/local/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Traceback (most recent call last):
File "/Users/MAM/Documents/gitrepos/latest/sample-annotator/sample_annotator/non_edge.py", line 20, in
map = pd.read_csv('new_env_mapping.csv')
File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/sample-annotator-G4hsqM_G-py3.9/lib/python3.9/site-packages/pandas/util/_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/sample-annotator-G4hsqM_G-py3.9/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 680, in read_csv
return _read(filepath_or_buffer, kwds)
File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/sample-annotator-G4hsqM_G-py3.9/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 575, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/sample-annotator-G4hsqM_G-py3.9/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 933, in init
self._engine = self._make_engine(f, self.engine)
File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/sample-annotator-G4hsqM_G-py3.9/lib/python3.9/site-packages/pandas/io/parsers/readers.py", line 1217, in _make_engine
self.handles = get_handle( # type: ignore[call-overload]
File "/Users/MAM/Library/Caches/pypoetry/virtualenvs/sample-annotator-G4hsqM_G-py3.9/lib/python3.9/site-packages/pandas/io/common.py", line 789, in get_handle
handle = open(
FileNotFoundError: [Errno 2] No such file or directory: 'new_env_mapping.csv'

@turbomam
Copy link
Member

Thats not at all surprising for a Python script contributed by somebody that sin't use to working collaboratively with a source code management tool like GitHub and an enviroment manager like Poetry.

The bottom line is that @jeaniceangelica had a good way of setting this script and its dependencies up on her computer, and that's not all in place on my computer.

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

No branches or pull requests

2 participants