-
Notifications
You must be signed in to change notification settings - Fork 15
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
Devel #1302
Changes from all commits
5c70a5e
1d041f5
7669be9
d24ddb5
1a676fb
95f8a20
4814cdc
fceebfc
eeaa6f3
640405c
340d2f1
e999eab
f5c70a9
098a79e
5559799
2573dd2
ee9e283
6a1bf18
e90c959
b7d649a
d204783
d2c79bc
3dc995f
13f4b1a
5894201
b14a772
90ed49d
ed6bca9
6b04f3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length = 100 |
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!" | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add this to issue #1300 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||||||||
--------- | ||||||||||
|
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 |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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