Skip to content

Commit 3cce0a9

Browse files
pr updates
Co-authored-by: Donald Campbell <[email protected]>
1 parent d36f82c commit 3cce0a9

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

.github/workflows/pytest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
python-version: ${{ matrix.python-version }}
3535

36-
- name: Install dev dependancies
36+
- name: Install dev dependencies
3737
run: if [ -f requirements/requirements-dev.txt ]; then pip install -r requirements/requirements-dev.txt; fi
3838

3939
- name: Install package

README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<h1 align="center">pepdbagent</h1>
2-
<p align="center">
32

43
[![PEP compatible](https://pepkit.github.io/img/PEP-compatible-green.svg)](https://pep.databio.org/)
54
![Run pytests](https://github.com/pepkit/pepdbagent/workflows/Run%20pytests/badge.svg)
@@ -8,7 +7,6 @@
87
[![Downloads](https://static.pepy.tech/badge/pepdbagent)](https://pepy.tech/project/pepdbagent)
98
[![Github badge](https://img.shields.io/badge/source-github-354a75?logo=github)](https://github.com/pepkit/pepdbagent)
109

11-
</p>
1210

1311
---
1412

@@ -19,12 +17,12 @@
1917
---
2018

2119
`pepdbagent` is a Python library and toolkit that gives a user-friendly
22-
interface to connect, upload, update and retrieve information from pep database. This library is designed to work
23-
to be used by PEPhub, but it can be used for any other purpose, to manage data in pep database.
20+
interface to connect, upload, update and retrieve information from the pep database. This library is designed to work
21+
with PEPhub, but it can be used for any other purpose.
2422

25-
pepdbagent creates a connection to the database and creates table schemas for the PEPhub database if necessary.
23+
`pepdbagent` creates a connection to the database and creates table schemas for the PEPhub database if necessary.
2624
Core database is `postgres` database, but it can be easily extended to other relational databases.
27-
To use `pepdbagent`, you need to have a database instance running with it's credentials.
25+
To use `pepdbagent`, you need to have a database instance running with its credentials.
2826
If the version of the database schema is not compatible with the version of `pepdbagent`, it will throw an exception.
2927

3028
## Installation
@@ -128,7 +126,7 @@ Example:
128126
# search for a specified pattern of namespace in database.
129127
agent.namespace.get(query='Namespace')
130128

131-
# By default all get function will retrun namespace information for public projects,
129+
# By default all get functions will return namespace information for public projects,
132130
# To get information with private projects, admin list should be provided.
133131
# admin list means list of namespaces where user has admin rights
134132
# For example:

pepdbagent/modules/namespace.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,19 @@ def stats(self, namespace: str = None, monthly: bool = False) -> NamespaceStats:
226226
number_of_month = 12 * 3
227227
today_date = datetime.today().date() + timedelta(days=1)
228228
three_month_ago = today_date - timedelta(days=number_of_month * 30 + 1)
229-
statement_update = select(Projects.last_update_date).filter(
229+
statement_last_update = select(Projects.last_update_date).filter(
230230
Projects.last_update_date.between(three_month_ago, today_date)
231231
)
232-
statement_create = select(Projects.submission_date).filter(
232+
statement_create_date = select(Projects.submission_date).filter(
233233
Projects.submission_date.between(three_month_ago, today_date)
234234
)
235235
if namespace:
236-
statement_update = statement_update.where(Projects.namespace == namespace)
237-
statement_create = statement_create.where(Projects.namespace == namespace)
236+
statement_last_update = statement_last_update.where(Projects.namespace == namespace)
237+
statement_create_date = statement_create_date.where(Projects.namespace == namespace)
238238

239239
with Session(self._sa_engine) as session:
240-
update_results = session.execute(statement_update).all()
241-
create_results = session.execute(statement_create).all()
240+
update_results = session.execute(statement_last_update).all()
241+
create_results = session.execute(statement_create_date).all()
242242

243243
if monthly:
244244
year_month_str_submission = [

0 commit comments

Comments
 (0)