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

Added txt file handling for bibcodes in run.py #110

Merged
merged 10 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade wheel setuptools pip
python -m pip install --upgrade wheel setuptools pip==24.0
pip install -U -r requirements.txt
pip install -U -r dev-requirements.txt

- name: Test with pytest
run: |
Xvfb :99 -ac -screen 0 1024x768x8 &
export DISPLAY=:99
py.test -vv -s
py.test -vv -s --cov=.

- uses: actions/upload-artifact@v2
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-adsorcid
path: .coverage


coveralls:
Expand All @@ -49,13 +49,14 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade wheel setuptools pip
python -m pip install --upgrade wheel setuptools pip==24.0
pip install coverage==5.2.1
pip install coveralls==2.2.0

- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: coverage-adsorcid
path: .coverage

- name: Coveralls
run: coveralls
Expand Down
14 changes: 12 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,19 @@ def reprocess_bibcodes(bibcodes, force=False):

if type(bibcodes) != list:
if type(bibcodes) == str:
bibcodes = [bibcodes]
if bibcodes.startswith('@'):
tmp_bibcodes = []
with open(bibcodes.replace('@', '')) as fp:
for line in fp:
if line.startswith('#'):
continue
b = line.strip()
tmp_bibcodes.append(b)
bibcodes = tmp_bibcodes
else:
bibcodes = [bibcodes]
else:
raise TypeError('Bibcodes must be list or string')
raise TypeError('Bibcodes must be list, string, or filename starting with @')

for bibcode in bibcodes:
logger.debug('Reprocessing bibcode {}'.format(bibcode))
Expand Down
Loading