Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Consolidated v4 fixes #9

Open
wants to merge 126 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
6557773
Integrated code developed at ESS, so far
nitrosx Jan 28, 2022
c9ae0a1
REL: v0.2.1
dylanmcreynolds Jan 28, 2022
7d05274
url fix
dylanmcreynolds Jan 28, 2022
0b6f6dc
REL: v0.2.2
dylanmcreynolds Jan 28, 2022
b901bac
Merge pull request #8 from dylanmcreynolds/easy_url
dylanmcreynolds Jan 31, 2022
e3b0802
Merge branch 'main' of https://github.com/SciCatProject/pyscicat into…
nitrosx Feb 2, 2022
ece5f75
Merge branch 'als-computing:main' into ESS-adding-in-house-functional…
nitrosx Feb 17, 2022
c63e3e2
Fixed linting issues
nitrosx Feb 17, 2022
e68745e
Merge branch 'ESS-adding-in-house-functionalities' of https://github.…
nitrosx Feb 17, 2022
90b64f0
Fixed issue in update_dataset_origdatablock
nitrosx Feb 24, 2022
df29d4c
added documentation and example
nitrosx Mar 8, 2022
fd40529
fixed linting
nitrosx Mar 9, 2022
56d2d34
updated documentation, included new documentation under how-to sectio…
nitrosx Mar 10, 2022
e7ebd0e
removed production packages from requirements-dev
nitrosx Mar 11, 2022
ab46162
Renamed example script, added test for new functions
nitrosx Mar 14, 2022
d13e053
Fixed linting
nitrosx Mar 14, 2022
399e349
Merge pull request #10 from SciCatProject/ESS-adding-in-house-functio…
dylanmcreynolds Mar 14, 2022
834e9ce
Added function to delete dataset by pid
nitrosx Mar 28, 2022
5cfed34
Added raw and derived upsert functions
abigailalexander Apr 13, 2022
832b476
added functions to load dataset by id and related orig_datablocks
nitrosx Apr 19, 2022
96155e1
Added upsert_dataset. Fixed bug in upsert funcs
abigailalexander Apr 21, 2022
d7b2330
Removed unneeded f in log/error statements causing bug
abigailalexander Apr 21, 2022
094ce4d
Added initial upsert test
abigailalexander Apr 26, 2022
e0c27ec
Added model and method for PublishedData
nitrosx Apr 26, 2022
85877f3
Fixing bugs in published data functions
nitrosx Apr 26, 2022
5f0205c
Fixed urls for upsert func and test
abigailalexander Apr 27, 2022
9d31fe3
remove pre-commit and re-add flake8
dylanmcreynolds Apr 27, 2022
46737e1
More remove pre-commit files
dylanmcreynolds Apr 27, 2022
982793c
remove pre-commit
dylanmcreynolds Apr 27, 2022
0ff79d7
Merge pull request #15 from dylanmcreynolds/remove-pre-commit
dylanmcreynolds Apr 27, 2022
e4cdf4d
Black formatting fixes
abigailalexander Apr 28, 2022
88ce96e
Raise ValueError in upsert_dataset
abigailalexander Apr 28, 2022
6852dc5
Added additional upsert test case
abigailalexander Apr 29, 2022
29eeb9f
Removed generic upsert, use raw/derived instead
abigailalexander Apr 29, 2022
66caeaa
Upsert inserts if dataset doesnt exist yet
abigailalexander Apr 29, 2022
246048a
Merge remote-tracking branch 'pyscicat-main/remove-precommit' into up…
abigailalexander May 4, 2022
7b0465f
Black format fix
abigailalexander May 9, 2022
1c1f178
Fixed indentation causing merge conflict
abigailalexander May 9, 2022
a1c6554
Merge remote-tracking branch 'origin/main' into upsert-dataset
abigailalexander May 9, 2022
3282dbc
Removed unneeded as_posix causing bug
abigailalexander May 13, 2022
e50ce4a
Merge pull request #2 from rosalindfranklininstitute/modify-setup
LAShemilt May 13, 2022
75d8f5b
Merge pull request #17 from rosalindfranklininstitute/modify-setup
dylanmcreynolds May 13, 2022
c1e5369
Merge pull request #12 from rosalindfranklininstitute/upsert-dataset
dylanmcreynolds Jun 1, 2022
cb0fa2c
wip right before finalizing th ecode for the PR
nitrosx Jun 3, 2022
a9edeab
Fixed naming convention on few functions, added test on published data
nitrosx Jun 3, 2022
cedfc34
merged with master. Fixed naming according to CRUD/mongodb convention
nitrosx Jun 3, 2022
479d41d
fixed linting and code styling
nitrosx Jun 3, 2022
f75027c
Do not log username and token
jl-wynen Jun 14, 2022
b2a93e5
Turn into non-f-string
jl-wynen Jun 14, 2022
5bfaba2
Merge pull request #21 from jl-wynen/do-not-log-credentials
dylanmcreynolds Jun 14, 2022
6b7f729
Merge pull request #3 from SciCatProject/main
LAShemilt Jun 15, 2022
0c37af8
Added update dataset method with patch
abigailalexander Jun 15, 2022
25b3e40
Added update dataset mock test
abigailalexander Jun 15, 2022
38d7053
Modified update dataset test
abigailalexander Jun 15, 2022
98acc0c
Removed upsert method and tests
abigailalexander Jun 16, 2022
d6361e0
modified update dataset format and url encoding
abigailalexander Jun 16, 2022
927be04
flake8 linting changes
abigailalexander Jun 16, 2022
08d524a
Changed functions names according to what agreed on PR #20
nitrosx Jun 16, 2022
610440a
Implemented new naming
nitrosx Jun 17, 2022
ba8e2dc
Merge branch 'main' of https://github.com/SciCatProject/pyscicat into…
nitrosx Jun 17, 2022
1ed2757
Add more model fields
jl-wynen Jun 30, 2022
a4aee32
add logo
zjttoefs Jul 5, 2022
b9bde12
fix sphynx build
dylanmcreynolds Jul 6, 2022
66f7670
Merge pull request #24 from SciCatProject/ESS
dylanmcreynolds Aug 7, 2022
21b64ec
Merge branch 'update-dataset' of github.com:rosalindfranklininstitute…
dylanmcreynolds Aug 7, 2022
50d338f
fix merge
dylanmcreynolds Aug 7, 2022
41bd226
Merge branch 'rosalindfranklininstitute-update-dataset'
dylanmcreynolds Aug 7, 2022
51840a4
Update model.py
nitrosx Aug 10, 2022
b8b06f8
Update model.py
nitrosx Aug 10, 2022
001be3e
Merge pull request #25 from jl-wynen/model-missing-fields
dylanmcreynolds Aug 10, 2022
5a18294
REL: v0.2.3
dylanmcreynolds Aug 10, 2022
985e857
Remove code duplication in client
jl-wynen Aug 17, 2022
0650844
Remove log call in client constructor
jl-wynen Aug 17, 2022
6c0b7c0
Log in via either Users/login or auth/msad
jl-wynen Sep 29, 2022
febcf69
Merge pull request #31 from jl-wynen/user-auth
dylanmcreynolds Nov 8, 2022
b66a943
Merge branch 'main' into client-refactor
dylanmcreynolds Nov 8, 2022
07c1b5f
Fix call to urljoin
jl-wynen Nov 9, 2022
448ef72
Merge pull request #27 from jl-wynen/client-refactor
dylanmcreynolds Nov 9, 2022
716b014
small fixes to model and search
toqduj Nov 10, 2022
09cea0e
Merge branch 'SciCatProject:main' into main
toqduj Nov 10, 2022
98fa114
Merge pull request #32 from BAMresearch/main
nitrosx Nov 11, 2022
b220051
Implement upload functions for proposals, samples and instruments
Jan 27, 2023
3f8cd33
Test upload functions for proposals, samples and instruments
Jan 27, 2023
6216e10
Update data model
Jan 27, 2023
15364ef
Update documentation
Jan 27, 2023
bfed3c8
Implement update functions for proposals, samples and instruments
Jan 27, 2023
a3a4276
Fix documentation
Jan 27, 2023
dc86102
Flake8 compliance
Jan 27, 2023
1ee0bd3
Update-function of the form <api-endpoint>_update
Jan 30, 2023
336fc87
Rename update_dataset() to datasets_update() in client.
Jan 30, 2023
03e0628
Merge pull request #35 from eilmiv/more_upload_functions
nitrosx Jan 31, 2023
ea0e048
adding some tests to work against a scicat v4 backend.
LAShemilt Mar 16, 2023
7c76635
Restructured the code so that we can install the optional requiments …
LAShemilt Mar 17, 2023
76f14a1
moving the extra tests into the new test suite
LAShemilt Mar 17, 2023
29bfeb2
reducing the version of python as 3.8 is not the requirment
LAShemilt Mar 20, 2023
3fc3b2e
porting tests to pyscicat and linting with flake8
LAShemilt Mar 20, 2023
3e16177
putting the python version to the lowest verions that is built agains…
LAShemilt Mar 20, 2023
8b02d37
Removing the forward / before Datasets. If this is given in the endpo…
LAShemilt Apr 19, 2023
291858f
testing update dataset now that the getter methods work
LAShemilt Apr 19, 2023
e0371e3
move the integration tests out into their own package so they can be …
LAShemilt Apr 19, 2023
b2336fa
first attempt at an actions workflow to do the integration testing.
LAShemilt Apr 21, 2023
dddf664
changing linting and adding steps
LAShemilt Apr 21, 2023
f677054
changing linting and adding steps
LAShemilt Apr 21, 2023
6b84741
correct name for the scicat backend service
LAShemilt Apr 21, 2023
88343de
adding environmental variables
LAShemilt Apr 21, 2023
452df36
remove subtests dependency
LAShemilt Apr 21, 2023
ecd84c4
solving merge
LAShemilt May 11, 2023
b5e7ffb
removing methods from v4
LAShemilt May 11, 2023
d3ff9d1
remove erroneous line in coverage stage of integration-testing.yml
LAShemilt May 11, 2023
8350d3c
replace pip install from requirements-dev.txt with the .[dev] option …
LAShemilt Jun 2, 2023
420f88b
updating the tests mocks to be inline with the new backend
LAShemilt Jun 6, 2023
75c1f9a
liniting
LAShemilt Jun 6, 2023
55d0f38
updating deprecated config - license_file to license_files
LAShemilt Jun 6, 2023
6f13a4e
excluding continuous_integration folder that is used in workflows but…
LAShemilt Jun 6, 2023
a66551b
run just the integration tests
LAShemilt Jun 6, 2023
16a5e98
Merge pull request #40 from rosalindfranklininstitute/v4-datasets
dylanmcreynolds Jun 7, 2023
46a69f4
removing quotation marks that causes pypi to fail
LAShemilt Jun 27, 2023
5ad874b
Merge pull request #41 from rosalindfranklininstitute/setup-cfg-hotfix
dylanmcreynolds Jun 27, 2023
70a4032
add default value None for all optional parameters
Aug 2, 2023
a30a4ac
update to flake8-6.1
Aug 2, 2023
3628eb9
pydantic v2 no longer converts int to str automatically
Aug 2, 2023
f321072
Merge pull request #46 from eilmiv/pydantic_v2_compatible
dylanmcreynolds Aug 2, 2023
c3cbb2f
This commit makes a small change with the client in order to better s…
JeffreyFG Aug 25, 2023
23e56fd
removed unnecessary comment about datasetType
JeffreyFG Sep 12, 2023
d0c2a57
fixed small comment error about which dataset is default
JeffreyFG Sep 12, 2023
b7170c2
Update model.py
JeffreyFG Sep 13, 2023
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
58 changes: 58 additions & 0 deletions .github/workflows/integration-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Integration tests V4

on:
pull_request:
branches:
- main

jobs:
container_job:
runs-on: ubuntu-latest

services:
mongo:
image: mongo
ports:
- 27107:27107
scicat-backend:
image: ghcr.io/scicatproject/scicat-backend-next:stable
ports:
- 3000:3000
env:
MONGODB_URI: mongodb://mongo:27017/scicat
EXPRESS_SESSION_SECRET: "${EXPRESS_SESSION_SECRET}"
JWT_SECRET: "${JWT_SECRET}"
PORT: 3000
HTTP_MAX_REDIRECTS: 5
HTTP_TIMEOUT: 5000
JWT_EXPIRES_IN: 3600
SITE: SAMPLE-SITE
PID_PREFIX: PID.SAMPLE.PREFIX
DOI_PREFIX: DOI.SAMPLE.PREFIX
METADATA_KEYS_RETURN_LIMIT: 100
METADATA_PARENT_INSTANCES_RETURN_LIMIT: 100
ADMIN_GROUPS: admin,ingestor

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- run: source continuous_integration/scripts/install.sh


- run: |
set -vxeuo pipefail
python -m pip install .
python -m pip install .[dev]
python -m pip list

- run: |
set -vxeuo pipefail
coverage run -m pytest tests/tests_integration/tests_integration.py
coverage report
env:
BASE_URL: http://localhost:3000/api/v3
SCICAT_USER: ingestor
SCICAT_PASSWORD: aman
14 changes: 0 additions & 14 deletions .github/workflows/linting.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
shell: bash -l {0}
run: |
set -vxeuo pipefail
python -m pip install -r requirements-dev.txt
python -m pip install .[dev]
python -m pip list
- name: Build Docs
shell: bash -l {0}
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- cron: '00 4 * * *' # daily at 4AM

jobs:

build:

runs-on: ubuntu-latest
Expand All @@ -31,11 +32,19 @@ jobs:
shell: bash -l {0}
run: |
set -vxeuo pipefail
python -m pip install -r requirements-dev.txt
python -m pip install .[dev]
python -m pip install .[hdf5]
python -m pip list

- name: Lint with flake8
shell: bash -l {0}
run: |
set -vxeuo pipefail
python -m flake8

- name: Test with pytest
shell: bash -l {0}
run: |
set -vxeuo pipefail
coverage run -m pytest -v
coverage run -m pytest --ignore tests_integration -v
coverage report
15 changes: 0 additions & 15 deletions .pre-commit-config.yaml

This file was deleted.

Binary file added docs/pyscicatlogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
164 changes: 164 additions & 0 deletions docs/pyscicatlogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
14 changes: 14 additions & 0 deletions docs/source/howto/ingest.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ from pyscicat.model import (
Datablock,
DataFile,
Dataset,
Sample,
Ownable
)

Expand Down Expand Up @@ -61,6 +62,19 @@ Note that we store the provided dataset_id in a variable for later use.

Also note the `sourceFolder`. This is a folder on the file system that SciCat has access to, and will contain the files for this `Dataset`.

Proposals and instruments have to be created by an administrator. A sample with `sampleId="gargleblaster"` can be created like this:
```python
sample = Sample(
sampleId="gargleblaster",
owner="Chamber of Commerce",
description="A legendary drink.",
sampleCharacteristics={"Flavour": "Unknown, but potent"},
isPublished=False,
**ownable.dict()
)
sample_id = client.upload_sample(sample) # sample_id == "gargleblaster"
```

## Upload a Datablock

```python
Expand Down
Loading