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

Devel #1302

Closed

Devel #1302

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5c70a5e
applied potential fix to deprecation warning
nedvedba Jan 16, 2025
1d041f5
added updated version t0 requirements.txt
nedvedba Jan 23, 2025
7669be9
corrected imported member
nedvedba Feb 3, 2025
d24ddb5
Update the schema documentation to improve the usability.
JoshuaSBrown Feb 4, 2025
1a676fb
Add example schema with a reference
JoshuaSBrown Feb 4, 2025
95f8a20
Add notebook for linting jupyter
JoshuaSBrown Feb 5, 2025
4814cdc
Using working directory option
JoshuaSBrown Feb 5, 2025
fceebfc
Update .github/workflows/jupyternotebook-lint.yml
JoshuaSBrown Feb 5, 2025
eeaa6f3
Update python notebooks
JoshuaSBrown Feb 5, 2025
640405c
Attempt to fix jupyternote book linting errors
JoshuaSBrown Feb 7, 2025
340d2f1
Format with black
JoshuaSBrown Feb 7, 2025
e999eab
Specify line length with black to be consistent with flake8
JoshuaSBrown Feb 7, 2025
f5c70a9
Merge pull request #1291 from ORNL/1290-bug-fix-jupyternotebook-docs
JoshuaSBrown Feb 7, 2025
098a79e
Add a Changelog comment
JoshuaSBrown Feb 7, 2025
5559799
Change line length to 88
JoshuaSBrown Feb 7, 2025
2573dd2
Add black formatters
JoshuaSBrown Feb 7, 2025
ee9e283
Make formatting consistent across project
JoshuaSBrown Feb 7, 2025
6a1bf18
Fix linter
JoshuaSBrown Feb 7, 2025
e90c959
Temporarily keep line length in black to 79 and address in separate i…
JoshuaSBrown Feb 7, 2025
b7d649a
Change line length to 88 for now
JoshuaSBrown Feb 7, 2025
d204783
Merge pull request #1286 from ORNL/1280-docs-improve-user-docs-for-sc…
JoshuaSBrown Feb 10, 2025
d2c79bc
updated changelog
nedvedba Feb 10, 2025
3dc995f
Merge branch 'devel' into fix-1223
nedvedba Feb 10, 2025
13f4b1a
Merge pull request #1289 from ORNL/1288-notebook-linter
JoshuaSBrown Feb 10, 2025
5894201
Merge branch 'devel' into fix-1223
nedvedba Feb 10, 2025
b14a772
Merge pull request #1239 from ORNL/fix-1223
nedvedba Feb 10, 2025
90ed49d
Fix bug in CI scripts associated with repo and gcs image build
JoshuaSBrown Feb 10, 2025
ed6bca9
Merge pull request #1298 from ORNL/1297-bug-repo-gcs-image
JoshuaSBrown Feb 10, 2025
6b04f3b
Merge pull request #1301 from ORNL/release_February_2025
JoshuaSBrown Feb 11, 2025
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
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 100
6 changes: 3 additions & 3 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
sudo apt-get install -y python3-sphinx sphinx-rtd-theme-common
pip install sphinx_rtd_theme recommonmark flake8 black pytest pytest-cov black[jupyter]
- name: Black formatting checks
run: black --exclude '/jupyter_notebooks/' --check .
run: black --line-length 88 --exclude '/jupyter_notebooks/' --check .
- name: Lint with flake8
run: |
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics --max-line-length 100 .
flake8 --count --statistics --max-line-length 100 .
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics .
flake8 --count --statistics .
40 changes: 40 additions & 0 deletions .github/workflows/jupyternotebook-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Jupyter Notebook Linter
on:
push:
paths:
- '**/*.ipynb'
- '.github/workflows/jupyternotebook-lint.yml'

jobs:
lint-jupyter:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout the repository
- name: Checkout Code
uses: actions/checkout@v4

# Step 2: Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Specify the Python version

# Step 3: Install dependencies
- name: Install nbQA, flake8, and black
run: |
pip install nbqa flake8 black

# Step 4: Run flake8 and black on notebooks in ./jupyter_notebooks folder
- name: Lint Jupyter Notebooks with flake8
run: nbqa flake8 .
working-directory: jupyter_notebooks

- name: Format Jupyter Notebooks with black
run: nbqa black . --check
working-directory: jupyter_notebooks

# Step 5: Report status
- name: Complete
run: echo "Jupyter Notebook linting completed!"

4 changes: 4 additions & 0 deletions .gitlab/build/build_gcs_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ build-gcs:
- cmake/**/*
- repository/docker/entrypoint_authz.sh
- repository/docker/Dockerfile.gcs
- repository/CMakeLists.txt
- repository/gridftp/**/*
when: on_success
script:
- BRANCH_LOWER=$(echo "$CI_COMMIT_REF_NAME" | tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -70,5 +72,7 @@ retag-image:
- cmake/**/*
- repository/docker/entrypoint_authz.sh
- repository/docker/Dockerfile.gcs
- repository/CMakeLists.txt
- repository/gridftp/**/*
when: never
- when: on_success
10 changes: 8 additions & 2 deletions .gitlab/build/build_repo_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ build-repo:
- changes:
- docker/**/*
- scripts/**/*
- web/**/*
- common/proto/**/*
- .gitlab-ci.yml
- CMakeLists.txt
- cmake/**/*
- repository/CMakeLists.txt
- repository/server/**/*
when: on_success

retag-image:
Expand All @@ -42,9 +45,12 @@ retag-image:
- changes:
- docker/**/*
- scripts/**/*
- web/**/*
- common/proto/**/*
- .gitlab-ci.yml
- CMakeLists.txt
- cmake/**/*
- repository/CMakeLists.txt
- repository/server/**/*
when: never
- when: on_success

10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
17. [1168] - Add authz unit testing to the CI
18. [1200] - Add JavaScript linter (eslint) and (prettier) formatter for JavaScript
19. [1180] - Refactor of authz foxx module, split into objects and added unit tests
20. [1257] - Bug in authz library parsing of authz.conf file, globus paths incorrectly sanitized when using just '/'
21. [1255] - Fixes bug, in libauthz with log_path var not being read in from config file.
22. [1268] - Bug fixes unbound variable in foxx entrypoint file.
23. [1269] - Update Arangodb to 3.12.4
20. [1223] - Fix deprecated method usage for Protobuf in Python client library
21. [1257] - Bug in authz library parsing of authz.conf file, globus paths incorrectly sanitized when using just '/'
22. [1255] - Fixes bug, in libauthz with log_path var not being read in from config file.
23. [1268] - Bug fixes unbound variable in foxx entrypoint file.
24. [1269] - Update Arangodb to 3.12.4
25. [1288] - Bug Jupyternote books in documentation were fixed.
Copy link

Choose a reason for hiding this comment

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

issue (typo): Typo: "Jupyternote books" should be "Jupyter notebooks"

Suggested change
25. [1288] - Bug Jupyternote books in documentation were fixed.
25. [1288] - Bug Jupyter notebooks in documentation were fixed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please add this to issue #1300

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please add this in an issue and link to #1300

Copy link

Choose a reason for hiding this comment

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

I have created an issue for your comment: #1307


# v2024.6.17.10.40

Expand Down
169 changes: 169 additions & 0 deletions doc_source/source/user/web/portal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,175 @@ Search

The ``Search`` tab below the action buttons allows users to query DataFed for data matching a specified metadata expression within a specified scope.

Schemas
-------

DataFed currently supports schema creation for records through the web portal.

Schema Creation
^^^^^^^^^^^^^^^

To create a new schema, navigate to the main dashboard and click the ``Schemas`` button. This will open the ``Create New Schema`` dialog, which consists of three separate tabs: ``General``, ``Definition``, and ``References``.

- **General Tab**:
In this tab, you must provide a valid string identifier (`ID`) and a brief `Description` of the schema.

- **Definition Tab**:
This tab requires a **valid JSON Schema definition**. DataFed conforms to the official [JSON Schema standard](https://json-schema.org/).

- **References Tab**:
This section lists locations where the schema is referenced within DataFed.
Comment on lines +116 to +117
Copy link

Choose a reason for hiding this comment

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

issue (typo): Typo: "section" should be "tab"

Under the "References Tab" section, it currently says, "This section lists locations...". It should be "This tab lists locations...".

Suggested change
- **References Tab**:
This section lists locations where the schema is referenced within DataFed.
- **References Tab**:
- This tab lists locations where the schema is referenced within DataFed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Please add this to issue #1300

Copy link

Choose a reason for hiding this comment

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

I have created an issue for your comment: #1303


### Example Schema Definition

The following is an example of a JSON schema definition used in DataFed:

.. code-block:: json
{
"properties": {
"Cat": {
"properties": {
"Height": {
"type": "string"
},
"LastSeen_DateTime": {
"type": "string"
},
"Name": {
"type": "string"
},
"Photo_Date": {
"type": "string"
},
"Weight": {
"type": "string"
}
},
"required": [
"Name",
"Photo_Date",
"Height",
"Weight",
"LastSeen_DateTime"
],
"type": "object"
},
"Owner": {
"properties": {
"Address": {
"type": "string"
},
"Name": {
"type": "string"
}
},
"required": [
"Name",
"Address"
],
"type": "object"
}
},
"required": [
"Cat",
"Owner"
],
"type": "object"
}

### Example Schema Using Enums

The following example demonstrates the use of **enums** to enforce predefined choices for various fields:

.. code-block:: json
{
"properties": {
"data_format": {
"description": "The format in which experimental data is stored.",
"enum": [
"CSV",
"JSON",
"HDF5",
"NetCDF"
],
"type": "string"
},
"experiment_type": {
"description": "The type of scientific experiment being conducted.",
"enum": [
"Physics",
"Chemistry",
"Biology",
"Astronomy",
"Materials Science"
],
"type": "string"
},
"instrument": {
"description": "The scientific instrument used for measurements.",
"enum": [
"Spectrometer",
"Microscope",
"X-ray Diffractometer",
"Mass Spectrometer",
"Electron Microscope"
],
"type": "string"
},
"measurement_unit": {
"description": "The SI unit of measurement used in the experiment.",
"enum": [
"meters",
"kilograms",
"seconds",
"kelvin",
"moles",
"amperes",
"candela"
],
"type": "string"
},
"status": {
"description": "The current status of the experiment.",
"enum": [
"Pending",
"In Progress",
"Completed",
"Failed"
],
"type": "string"
}
},
"required": [
"experiment_type",
"measurement_unit",
"instrument",
"status",
"data_format"
],
"type": "object"
}

### Example Schema Using References

The following example demonstrates the use of **references** to existing schemas, assuming the previous schema was saved as **equipment** with verison number 0 **equipment:0**:

.. code-block:: json
{
"properties": {
"equipment": {
"$ref": "equipment:0"
},
"voltage": {
"type": "number"
}
},
"required": [
"voltage",
"equipment"
],
"type": "object"
}

Transfers
---------
Expand Down
2 changes: 1 addition & 1 deletion external/protobuf
Submodule protobuf updated 1498 files
12 changes: 12 additions & 0 deletions jupyter_notebooks/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[flake8]
max-line-length = 100

# Ignoring the following is specific to jupyternotebooks
#
# F821 - Ignore undefined variable errors, these are false positives in jupyter
# notebooks if they are defined in a previous cell.
# F841 - assigned to but unused, appears because the examples have code
# that the user will need to fill in.
# F401 - imported but unused, occurs because the user will need to fill in
# parts that require the import.
extend-ignore = F821, F401, F841
Loading