Skip to content

Commit

Permalink
CRIPT Python SDK 2.0 First Release (#272)
Browse files Browse the repository at this point in the history
* updated read me

* added CRIPT logo
* updated python badge to python 3.7 instead of python 3.9
* added a section that "we invite contribution"

* Create .gitignore

ignoring common files and directories that are unneeded

* added issue templates

* Update README.md

* removed MANIFEST from the .gitignore list

* Update .gitignore

* removed smartphone section

* Update .gitignore

added mypy cache to be ignored

* created setup.py and setup.cfg

* Create pyproject.toml

* setup documentation mkdocs.yaml file

* Create requirements_docs.txt

* Create extra.css

* Create index.md

brought it over from the old sdk docs

* added .pytest_cache to .gitignore file

* Create pull_request_template.md

* moved pyproject.toml from src/ to the project root directory

* made nodes/ a package

* added supporting nodes

* file.py
* group.py
* user.py

* added primary_node.py

* added the class for all primary nodes

* renamed primary_node.py to primary_base_node.py to make it clearer and more self documenting

* added a shell of all subobjects

* reformatted Primary and Supporting Nodes

* updated PR template

* Make Cript installable via `pip` (#16)

* make cript installable

* add install test line

* explicitly request python3 in tests

* add missing nodes

* fixing init files

* add missing file

* simplify test

* fix imports

* add missing nodes

* fixing init files

* simplify test

* created primary_node.py

* added str method to primary_node.py

* added str method to primary_node.py

* working on the abstract primary_node.py

* added all fields and default values to primary_base_node.py

* updated primary_base_node.py

* updated __str__ method

* updated __str__ method

* making URL and UID into string types only

if there is no URL/UID then the URL/UID string is empty

* updated docstring for base __str__ method

* address requested changes

* add getter properties

* first draft

* parameter works

* add missing file

* remove typo

* remove empty nodes

* add nice doc strings

* add test to CI

* bring primary node up to date

* blackify

* blackify

* add mock validation function

* repsond to Navid's comments

* removing old doc strings

* explain None value for parameter unit

* ensure correct setters

* remove unnecessary json serialization

* safe money on tests

* json deserialization works

* add user friendly access to load nodes

* finishing touches on json serialization

* Add license and contributor tracking

* reenable all tests

* updated README.md with disclaimer that the SDK is still under development

* Create LICENSE.md

* updated readme

* Create SECURITY.md

* remove duplicate license

* specify right license file

* trunk for software quality (#34)

* add trunk init

* fix tech debt

* reformat readme

* fix CLI tests

* fixed typo for `Dependencies: JSONSchema`

* fixed typo for `Dependencies: Requests` and `Dependencies: PyTests` and `Dependencies: mypy`

* Add Quantity implementation

* add  tests for quantity

* Create codeql.yml

# Description

This workflow running on ever PR is good to catch any security vulnerabilities early

* Implement Software Subobject (#28)

* temporary step

* add tests for citation and reference

* add new software node file

* fix import

* add missing url property

* fix test for refernce

* Navids comments

* implement the software subobject

* make better exceptions for JSON

* trunk code fixes

* fix lines

* some fixes

* code style

* autoformat

* Impelement removing children from a node (#23)

* implement removing nodes fully

* add tests

* autoformat

* Implement a local search for nodes (#24)

* implement search of child nodes

* add tests for search

* add comments to implementation trick

* add additional comments

* fix code style

* cycle protection in search

* Create api (#18)

* WIP API object init

* WIP API

* moved API into an api/ directory
* added empty save, get_my_groups, gey_my_projects
* working on delete method to make it clean and intuitive
* added empty PrimaryNode base class

* wrote the delete method for the api class

* Update .gitignore

added mypy into ignored section

* Create requirements.txt

* created an empty file for Group and User

* setup get_my_user( ) method for the API class

* fixed grammar of the ConnectionError exception

* added placeholders for project, user, and group nodes

* added type hinting for return values

* added type hinting to get_my_groups( )
* added type hinting to get_my_projects( )
* added type hinting to get_my_user( )

* setting up search method

* added docstrings

* added comment explaining _valid_search_modes.py

* wrote _get_db_schema() method and it's working

* added tests for api.py

* moved api test into api directory

* renamed to api to test_api

* reformatted everything with black

* setting up tests for getting db schema

* added typehint to a get_db_schema method

* added setup for pypi

pretty much brought over what existed in the old SDK and changed it where it made sense

* converted docstrings from google to numpy as decided

* removed the main function

* added tests for api

* reformatted setup.py with black

* formatting tests

* small formatting

* added todo to api.py

* updated setup.cfg based on develop branch

* added docstrings and reformatted code

* moved requirements

* moved black and mypy from requirements.txt to requirements_dev.txt
* updated mypy to newest version

* formatted requirements.txt

* renamed ConnectionError to CRIPTConnectionError

because ConnectionError is a built in error

* put API directory into src/cript/api/ directory

updated docstrings

* raising CRIPTConnectionError

* added error for InvalidVocabulary

* updated requirements.txt

* created functions for fetching and validating controlled vocabulary

* created functions for fetching and validating controlled schema

* caching host from API and changing classes as needed

* moving delete to be after

* added placeholder tests for api, vocab, and schema functions and class

* updated docstrings for what search returns

* changed paths to be from cript.

* changed docstring to be PrimaryBaseNode

* fixed repeated variable

* added API to __init__.py

* removing global host from api.py

tests are passing and working fine

* stripping ending "/" from host

* fix code style

* Cache api (#29)

* Improve error messages
* Cache global API and require context managers.
* Add env variables for API

* added brief docstrings to the save method

* added requested changes of delete method

* changed host for schema_validation.py and vocabulary.py

* updated test_vocab_and_schema.py

* updated requirements_dev.txt

* removed unused import

* formatted test_vocab_and_schema.py

* use access function for global cache API

* fix json type confusion

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* Implementation of all remaining subobjects (#41)

* implement property

* test property

* implement condition

* implement tests for condition

* implement ingredient

* add dummy values for property test

* add dummy values for condition test

* implement equipment with test

* implement computation forcefield

* add computational forcefield

* updated README.md python version

changed Installation section to say it requires Python 3.7+ instead of 3.9+ previously

* make a common base exception for CRIPT (#43)

* make a common base exception for CRIPT

* fix abc

* Finished Supporting Nodes (#44)

* added group constructor

* added dummy validate method

* reformatted with black

* WIP group.py

* added UneditableNodeError and UneditableAttributeError

* added base attributes to core.py base class

* finished setting up user.py

* set up user tests

* formatted with black

* set up group node and test

* added read only common attributes in the BaseNode class

* added test_group_to_json to test_group.py

* added user node and tests

* set up file.py

* update file node test file

* added validation of vocabulary

* optimized imports

* updated test_group.py and test_file.py

* updated test_file.py

* changed users list in group to always be a list

* updated user.py

* added kwargs to user and group.py

* updated comments

* file passing tests

* group node passing all tests

* user node passing all tests

* added kwargs to file constructor

* all files formatted and working

* changed type for type_

* removed UneditableNodeError

removed the error since it is not being used

* changed _verify_file_source scope

* updated handling uploading of a file

* updated file.py

* updated file.py

* small updates

* updated test_file.py

* updated test_file.py

* autoformat with trunk

* making requested changes for group.py

* changed the docstrings to refer to the data model
* changed dataclass List to be set to `field(default_factory=list)`
* updated the docstrings for `@users.setter`

* making requested changes for user.py

* changed the docstrings to refer to the data model
* changed dataclass List to be set to `field(default_factory=list)`

* making requested changes for file.py

* changed the docstrings to refer to the data model

* making requested changes for user.py and group.py

* calling `validate()` in the constructor
* calling the base node validate method

* autoformat with trunk

* setting group.py raises AttributeError

* removed setters for group.py

* setting an attribute on group.py raises an `AttributeError`instead of a custom `UneditableAttributeError`

* updated tests_group.py to work correctly with `AttributeError`

* setting user.py raises AttributeError

* removed setters for user.py

* setting an attribute on user.py raises an `AttributeError`instead of a custom `UneditableAttributeError`

* updated tests_user.py to work correctly with `AttributeError`

* removed `UneditableAttributeError`

* removed `UneditableAttributeError` import because it was an unused import in
    * group.py
    * user.py
    * test_group.py
    * test_user.py

* edited docstrings for test_group.py and test_user.py

* removed `UneditableAttributeError` from exceptions.py

* wrote `serialize_file_to_json` test_file.py

* changed pytest return fixture to be yield fixture so all tests can perform the same
* wrote out test_serialize_file_to_json, and it is written correctly, but found a bug within the serializer

* wrote test_group_node_json_roundtrip

it is currently coming out wrong

* updated test_group.py

* updated test_user.py

* wrote `test_user_serialization_and_deserialization`
* changed `user_node` to be a yield fixture insted of a return fixture

* autoformat with trunk

* fix tests. And make type_ type again

* updated test_group.py and test_user.py

* tests are passing
* user has a list of groups, that probably should be taken out because the new backend does not need it

* updated test_group.py and test_user.py

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* Updated pull request template

added a `Tests` section to encourage transparency about how the code was tested. The pull request template is not mandatory and is a suggestion, but I think this could be helpful

* Redesign of the API (#49)

* Allow manual connect options for JupyterNote books.

* remove manual caching of Vocab

* reform how vocab and schema is represented

* Fix tests, as they can't curently connect to back end

* fix tests

* --amend

* load req. for testing

* syntax

* implements Navids request of integrating vocab and schema into API

* fix issues

* Implement a cycle prevention (#42)

* add cycle protection in validation

* autoformat

* better name for cycle detection

* fix name everywhere

* trunk formatted codeql.yml

* fix trunk check

* Finished primary nodes (#52)

* added a setter for all list fields within project.py

* added some docstrings
more docstrings is needed

* added a small comment

* started adding tests to Project node

* optimized imports

* added docstrings

* tests

* added project constructor and validate method

* updated test_project.py

* setup collection.py and created test_collection.py

* added more to the __init__ method for collection.py

* added link to the data model paper

* set up  experiment.py

* set up test for test_collection.py

* formatted with black experiment.py

* set up tests for experiment node

* added docstrings and formatting

* set up inventory.py and test_inventory.py

* updated and alphabetically ordered the __init__.py within primary_nodes

* updated __init__.py for cript/ to include material

* updated __init__.py for cript/ to include material

* added condition to __init__.py

src/cript/nodes/subobjects/__init__.py
src/cript/nodes/__init__.py
src/cript/__init__.py

* setup process node with no tests yet

* added constructor

* setup data node

* setup computation.py node

* setup computational_process.py

* setup reference node

* updated collection.py

* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated collection.py

* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated computational_process.py

* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated computational_process.py

* set _json_attrs variable
* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated collection.py and computational_process.py

* set _json_attrs variable

* updated experiment.py

* set _json_attrs variable
* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated experiment.py

* set _json_attrs variable
* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated process.py

* set _json_attrs variable
* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated process.py

* set _json_attrs variable
* added **kwargs to the constructor
* returning copies of the dataclass attribute

* updated reference.py

* set _json_attrs variable
* added **kwargs to the constructor
* returning copies of the dataclass attribute

* setup material.py node

* setup conftest.py

* removed fixture from test_project.py and instead have it in conftest.py

* set up the needed tests for the material node

* set up the needed tests for the data node

* set up test_reference.py

* set up test_computation.py

* updated test_data.py

* updated test_collection.py

* fixing imports

* fixing circular import error in all the nodes. Currently typing most things as Any instead of proper node for a quick fix
    * add correct typings later
* reference and software nodes are written as subojects instead of primary objects.

* added prerequisite_processes field to process.py

* simple material test passing correctly

* added name attribute to material.py

* importing computation_forcefield correctly in packages

* updated process.py dataclass list defaults

* updated dataclass to have default values of `field(default_factory=list)` instead of `None`

* successfully running simple process test

* fixed typo in material.py

* test_create_simple_material running fine

* test_all_getters_and_setters successful!

* test_serialize_material_to_json successful!

* test_serialize_material_to_json successful
* created complex_material yield fixture
* formatted test_material.py with black

* test_deserialize_material_from_json filing

added the test, but it is failing the assertions

* test_create_inventory successful!

* changed inventory material to `materials` to make it more self-documenting

* temp fix

* test_get_and_set_inventory successful!

* reformatting

* crude fix for back end providing too much data

* updated test_data.py

* updated test_data.py

* importing references in all __init__.py

* changed reference.py from type_ to type

* changed computational_process.py from type_ to type

* updated reference.py

* set dataclass attributes from default None to field(default_factory=list)
* url property had a typo
* changed setter for authors parameter to be `new_authors` instead of `new_authors_list`

* importing reference from primary nodes __init__.py

* test_complex_process_node successful!

* test_serialize_process_to_json fail!

* formatted reference.py

* all primary nodes use default field

* updated primary nodes to use `field(default_factory=list)` instead of `None`

* fix the remaining material problem. Inherit the JsonAttributes from the PrimaryBaseNode instead of BaseNode.

* autoformat with trunk

* updated test_reference.py

* updated test_reference.py

* fix default int values

* autoformat with trunk

* updated test_reference.py

* updated test_reference.py type hinting

* test_serialize_reference_to_json successful!

* added _json_attrs to computational_process.py

* test_create_simple_computational_process successful

* added test_create_complex_computation_node to test_computation.py

* test_create_simple_data_node successful

* test_serialize_reference_to_json successful

* creating a conftest.py with all nodes to reuse for all tests

* typo in getter of data.py sample_preperation

* test_create_simple_computational_process successful!

* added `simple_quantity_node` & `simple_ingredient_node` fixtures

* test_create_simple_computational_process successful

* test_data.py tests successful

* test_serialize_data_to_json successful

* formatted test_data.py

* fix software test

* fix reference test

* fix API import error

* fix collection typo

* fix a bunch of trunk error

* fix faulty json error test

* Remove def json (#51)

* fix a bunch of trunk error

* fix faulty json error test

* only report json with sorted keys and remove defaults

* make tests pass again

* fix tests that didn't tolerate the changed json output

* set default None value of list to an empty list

* updated computation.py

* updated conftest.py

added software and software_configuration node

* test_create_complex_computation_node successful!

* updated data.py

* test_serialize_computation_to_json successful

* test_data_getters_and_setters successful!

* dataclass inheriting from PrimaryBaseNode

* optimized imports

* test_serialize_process_to_json successful!

* added `equipment` and `property` to conftest.py

* fixed process.py prerequisite_processes

* test_process.py passing

* test_process.py added comment

* fix user node

* updated conftest.py

* fixes for experiment

* updated conftest.py

* removed unused import
* and removed unused copy

* fix experiment None list

* updated test_file.py

* using file node fixture
* and removed copy because comparing dicts is more accurate than comparing strings

* updated test_reference.py

* using simple_reference_node fixture
* added test for getters and setters

* formatted test_process.py

* making base notes attribute editable

* test_computation_getters_and_setters successful

* optimized imports

* added simple_inventory_node

* test_inventory_serialization successful

* test_create_complex_computational_process successful

* fixed typo in computational_process.py
* wrote test for test_create_complex_computational_process

* added Integration tests to test_computational_process.py

* formatted test_computational_process.py

* fixed experiment name

* added name to dataclass and set up getters and setters

* experiment creation tests successful!

* test_create_simple_experiment successful
* test_create_experiment_full successful

* added simple_experiment_node fixture

* test_all_getters_and_setters_for_experiment successful!

* updated test_experiment.py

* updated docstrings

* test_experiment_json successful

* formatted test_experiment.py

* added test to test_experiment.py

* formatted conftest.py

* test_create_simple_collection successful

* added `simple_collection_node` to conftest.py

* formatted test_experiment.py

* test_collection_getters_and_setters successful

* added complex_collection_node to fixtures

* formatted conftest.py

* conftest.py: added docstrings

* test_serialize_collection_to_json successful

* added integration tests

* added comments

* test_create_simple_project successful

* formatted collection.py

* added simple_project_node to conftest.py

* updated project.py

* removing `Files: List[File]` from `Project node`
    * Files are no longer a part of the Project node per the manuscript
    * removing getters, setters, from dataclass and constructor
https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=8

* commented out `Group` nodes
    * `Groups` are not part of the Project node per the manuscript
    * removing getters, setters, from dataclass and constructor
https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=8

* removed `_set_node_or_list()` as it is not needed

* test_project_getters_and_setters successful

* added fixtures to conftest.py

* added complex_project_node
* added complex_material_node
* added simple_computation_forcefield
* formatted conftest.py with black

* test_material.py upadted and working fine

* test_serialize_project_to_json successful

* added integration tests for test_project.py

* updated computational_process.py

* updated data.py

* updated test_data.py and test_experiment.py

* updated inventory.py

* inventory.py: added an if statement if the list attributes are provided as `None`

* updated docstrings in reference.py

* updated material.py and process.py

updated if statement formatting in both files

* all tests passing successfully

* formatted process.py

* test_serialize_computational_process_to_json successful

* test_reference.py added TODO

* updated test_project.py

swapped out complex_project_node for simple_project_node to make reading it and seeing it easier

* updated test_material.py

* fixed the simple_material fixture to be function scoped instead of session scoped

* swapped out complex_material_node for simple_material_node to make reading it and seeing it easier

* updated test_experiment.py

* using simple_experiment_node for serialization instead of complex_experiment_node to make reading it easier and catching errors easier

* test_computation.py made expected node easier to read

* fix import test_collection.py

* updated test_complex_process_node

* test_complex_reference successful

* removed unused import `copy`

* updated test_material.py

* updated docstrings for inventory.py

* fixing format for trunk

* fixing format for trunk

* added `name` and `notes` to primary_base_node.py constructor

* added name and notes to computational_process.py

* added name and notes to data.py

* updated docstrings for computational_process.py

* updated data.py dataclass

* updated data.py constructor with `name` and `notes`

* updated inventory.py constructor with `name` and `notes`

* updated material.py constructor with `name` and `notes`

* updated process.py constructor with `name` and `notes`

* updated project.py constructor with `name` and `notes`

* updated project.py with `name` and `notes`

* added `name` and `notes` in the constructor
* added group to project again

* updated collection.py to inherit from PrimaryBaseNode dataclass

* removed experiment.py name setter

using the PrimaryBaseNode for name property and setter

* added a setter for name in primary_base_node.py

* formatted with black

* updated docstrings for collection.py

* made Project collection optional within constructor

* adding Group instead of Any
avoiding circular import

* making notes within the constructor optional

* material tests passing successfully

* inventory tests passing successfully

* added notes and name to computation.py

* data tests passing successfully

* computation tests passing successfully

* computational_process tests passing successfully

* process tests passing successfully

* added name and notes to constructor

* experiment tests passing

* collection tests passing

* project tests passing

* formatted with black

* updated test_material.py to use conftest.py

test_material.py used to use own fixtures that lead to repeat code and is now instead using conftest.py

* updated test_complex_process_node to use conftest fixtures

* test_reference.py using conftest.py fixture

* added todo to conftest.py

* formatted conftest.py with black

* added todo in conftest.py

* added complex_data_node

* updated complex_data_node fixture

* had a small typo where it said "fucntion" instead of "function"
* and the name had a typo that said "test_create_complex_data_node" instead of "complex_data_node"

* optimizing import

* formatted test_nodes_no_host.py with black

* using isort for files

* updated imports for tests_nodes_no_host.py

* formatting and optimizing imports

using isort and black

* updated tests conftest.py

* reformatted with black

* reformatted with black

* reformatted with black

* updated test_node_util.py

* trunk format

* fix json error raise

* gfix the API conftest to use yield

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* Python SDK Documentation Setup (#57)

* formatted test_data.py

* fix software test

* fix reference test

* fix API import error

* fix collection typo

* fix a bunch of trunk error

* fix faulty json error test

* Remove def json (#51)

* fix a bunch of trunk error

* fix faulty json error test

* only report json with sorted keys and remove defaults

* make tests pass again

* fix tests that didn't tolerate the changed json output

* set default None value of list to an empty list

* updated computation.py

* updated conftest.py

added software and software_configuration node

* test_create_complex_computation_node successful!

* updated data.py

* test_serialize_computation_to_json successful

* test_data_getters_and_setters successful!

* dataclass inheriting from PrimaryBaseNode

* optimized imports

* test_serialize_process_to_json successful!

* added `equipment` and `property` to conftest.py

* fixed process.py prerequisite_processes

* test_process.py passing

* test_process.py added comment

* fix user node

* updated conftest.py

* fixes for experiment

* updated conftest.py

* removed unused import
* and removed unused copy

* fix experiment None list

* updated test_file.py

* using file node fixture
* and removed copy because comparing dicts is more accurate than comparing strings

* updated test_reference.py

* using simple_reference_node fixture
* added test for getters and setters

* formatted test_process.py

* making base notes attribute editable

* test_computation_getters_and_setters successful

* optimized imports

* added simple_inventory_node

* test_inventory_serialization successful

* test_create_complex_computational_process successful

* fixed typo in computational_process.py
* wrote test for test_create_complex_computational_process

* started on docs

* started data, file, group documentation
* started on mkdocs.yml

* added Integration tests to test_computational_process.py

* formatted test_computational_process.py

* fixed experiment name

* added name to dataclass and set up getters and setters

* experiment creation tests successful!

* test_create_simple_experiment successful
* test_create_experiment_full successful

* added simple_experiment_node fixture

* test_all_getters_and_setters_for_experiment successful!

* updated test_experiment.py

* updated requirements_docs.txt

* updated file.py

* updated docstrings

* test_experiment_json successful

* formatted test_experiment.py

* added test to test_experiment.py

* formatted conftest.py

* test_create_simple_collection successful

* added `simple_collection_node` to conftest.py

* formatted test_experiment.py

* test_collection_getters_and_setters successful

* added complex_collection_node to fixtures

* formatted conftest.py

* conftest.py: added docstrings

* test_serialize_collection_to_json successful

* added integration tests

* added comments

* test_create_simple_project successful

* formatted collection.py

* added simple_project_node to conftest.py

* updated project.py

* removing `Files: List[File]` from `Project node`
    * Files are no longer a part of the Project node per the manuscript
    * removing getters, setters, from dataclass and constructor
https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=8

* commented out `Group` nodes
    * `Groups` are not part of the Project node per the manuscript
    * removing getters, setters, from dataclass and constructor
https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=8

* removed `_set_node_or_list()` as it is not needed

* test_project_getters_and_setters successful

* added fixtures to conftest.py

* added complex_project_node
* added complex_material_node
* added simple_computation_forcefield
* formatted conftest.py with black

* test_material.py upadted and working fine

* test_serialize_project_to_json successful

* added integration tests for test_project.py

* updated computational_process.py

* updated data.py

* updated test_data.py and test_experiment.py

* updated inventory.py

* inventory.py: added an if statement if the list attributes are provided as `None`

* updated docstrings in reference.py

* updated material.py and process.py

updated if statement formatting in both files

* all tests passing successfully

* formatted process.py

* test_serialize_computational_process_to_json successful

* test_reference.py added TODO

* updated test_project.py

swapped out complex_project_node for simple_project_node to make reading it and seeing it easier

* updated test_material.py

* fixed the simple_material fixture to be function scoped instead of session scoped

* swapped out complex_material_node for simple_material_node to make reading it and seeing it easier

* updated test_experiment.py

* using simple_experiment_node for serialization instead of complex_experiment_node to make reading it easier and catching errors easier

* test_computation.py made expected node easier to read

* added all subobjects to documentation

* added primary_nodes to documentation

* fix import test_collection.py

* updated test_complex_process_node

* test_complex_reference successful

* removed unused import `copy`

* updated test_material.py

* updated docstrings for inventory.py

* fixing format for trunk

* fixing format for trunk

* added CRIPT logo to home page and site logo

* testing out different docstring styles

* Google docstrings in file.py
     * added JSON to file.md
* numpy docstrings in users.py
* pep docstrings in group.py

* worked on data.py documentation

* updated file.py documentation

* updated file.py with docstrings

* added faq.md

* added exceptions.md

* updated mkdocs.yml

* reordered pages

* updated group documentation

* updated group documentation

* added JSON representation

* updated group documentation

* updated user node documentation

* added definition for the user node

* updated group documentation

* updated group documentation

* updated user documentation

* updated user documentation

* updated user documentation

* updated docstrings type

* updated file documentation

* updated group documentation

* updated user documentation

* added description to material node

* updated material documentation

* updated material documentation

* updated material documentation

* updated material documentation

* added `name` and `notes` to primary_base_node.py constructor

* added name and notes to computational_process.py

* added name and notes to data.py

* updated docstrings for computational_process.py

* updated data.py dataclass

* updated data.py constructor with `name` and `notes`

* updated inventory.py constructor with `name` and `notes`

* updated material.py constructor with `name` and `notes`

* updated process.py constructor with `name` and `notes`

* updated project.py constructor with `name` and `notes`

* updated project.py with `name` and `notes`

* added `name` and `notes` in the constructor
* added group to project again

* updated collection.py to inherit from PrimaryBaseNode dataclass

* removed experiment.py name setter

using the PrimaryBaseNode for name property and setter

* added a setter for name in primary_base_node.py

* formatted with black

* updated docstrings for collection.py

* made Project collection optional within constructor

* adding Group instead of Any
avoiding circular import

* making notes within the constructor optional

* material tests passing successfully

* inventory tests passing successfully

* added notes and name to computation.py

* data tests passing successfully

* computation tests passing successfully

* computational_process tests passing successfully

* process tests passing successfully

* added name and notes to constructor

* experiment tests passing

* collection tests passing

* project tests passing

* formatted with black

* updated test_material.py to use conftest.py

test_material.py used to use own fixtures that lead to repeat code and is now instead using conftest.py

* updated test_complex_process_node to use conftest fixtures

* test_reference.py using conftest.py fixture

* added todo to conftest.py

* formatted conftest.py with black

* added todo in conftest.py

* added cript

* updated documentation for some attributes and definition

updated documentation for following attributes
* `type`
* `citations`
* `process`
* `files`

* added complex_data_node

* adding complex data node as an example

* added minimal and maximal data node

* added reminder comment to later add developer documentation

* moving navigation to the top of mkdocs.yml

* updated complex_data_node fixture

* had a small typo where it said "fucntion" instead of "function"
* and the name had a typo that said "test_create_complex_data_node" instead of "complex_data_node"

* updated requirements_docs.txt

* updated documentation for file.py

* updated mkdocs.yml

* updated file.py

* optimizing import

* formatted test_nodes_no_host.py with black

* using isort for files

* updated imports for tests_nodes_no_host.py

* formatting and optimizing imports

using isort and black

* updated tests conftest.py

* reformatted with black

* reformatted with black

* reformatted with black

* updated test_node_util.py

* updated requirements_docs.txt

* trunk format

* fix json error raise

* gfix the API conftest to use yield

* mkdocs.yml watching `src/`

* telling `mkdocstrings` to watch `src/` for changes

* file node docs done

* updated project.py collections property docs

updated docstrings for collections property within project.py

* added docs for project.Material

* changing Material -> Materials like in datamodel

* project node docs done

* added data model link to project

* removed `required column` in docs

* added docstrings to collections.citations

* added docstrings to collections.cript_doi

* added docstrings to collections cript_doi and inventories

* updated collection's inventory docs

* updated collection's experiments docs

* updated collections constructor docs

* removed validate from collection.py as it is unneeded

* update wording for collections constructor

* updated definition docstring for collection.py

* added definition docstrings to experiment.py

* updated experiment.py constructor docs

* updated experiment.py constructor docs

* updated experiment.py process docs

* updated experiment.py funding docs

* updated experiment.py process docs with example

* updated experiment.py data docs

* updated experiment.py computations docs

* updated experiment.py computational_process docs

* updated experiment.py citations docs

* updated inventory.py docs definition

* updated inventory.py constructor docs

* updated inventory.py constructor docs

* updated inventory.py constructor docs

* updated material docs attributes section

* finished first draft of material node docs

* finished first draft of process node docs

* updated process.py docs

* updated process.py docs

* merging material from dev to docs and keeping docs

* updated data docs after merge conflict fix

* updated experiment.py docs after merge conflict fix

* updated material.py for test success!

all tests successful!

* updated experiment.py docs

* updated project.py docs

* updated experiment.py.py docs

* updated docs material

* finished docs first draft computation.py

* added description to computation.py

* added comment to TODO

* finished computational_process.py docs first draft

* finished computational_process.py docs first draft

* finished reference docs first draft

* added definition section

added definition section computational_process.py and computation.py

* updated navigation in mkdocs.yml

removed user node from primary nodes as it is under Supporting Nodes

* basic auto format

* fix not auto format issues

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* JSON node: [node type] (#71)

* make node field a list

* implementation of the change

* adjust tests to {'node': ['asdf']}

* add test for wrong node specification

* created docs CI/CD (#69)

* created docs CI/CD

* added comment and shortened file name

* updated .gitignore to ignore coverage.py (#68)

* updated .gitignore to ignore coverage.py

* updated .gitignore to ignore coverage.py

* created simple issue template (#64)

* created simple issue template

I keep finding myself not needing the other two issue templates, and I keep making my own. I think this is simplified and can help a lot!

* auto format

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* Introduce UID management to nodes and JSON (#72)

* first failing attempt

* first support for uids

* remove reference subobject

* support uid for nodes

* support return of handled ids, when json is generated.

* make primary nodes comply

* update conftest.py with subobjects

* add missing files

* more mising files

* get a few more tests passing

* add more subobject tests

* almost all test back in and passing

* resolve trunk issues

* fix import

* change uid prefix

* make a uid for every node

* remove cycle prevention

* implement deepcopy handling for uid's

* merge hell, getting tests ready again

* making progress

* getting uid serialization right

* fixed problem where all dictionaries ought to be nodes

* change cycle test to nodes, that actually can have cycles.

* make deepcopy an actual deep copy

* make conftest less of a beast

* missing files

* renaming complete simple and complex

* mend

* Create CI/CD of dependency security scanner (#60)

* Create dependency-review.yml

* trunk formatted dependency-review.yml with

* fix formatting

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* renaming GitHub workflow to tests.yml (#79)

* renaming workflow to tests.yml

* renaming workflow to tests

* Wip api (#59)

* setup paginator.py

* Update paginator.py

* moving `__enter__` and `__exit__` to the top

* moving connect and disconnect at top

it makes more sense logically for connect and disconnect to be near `__enter__` and `__exit__`

* updated comments for `_load_controlled_vocabulary`

* updated test_api.py

* updated docstrings and made them simpler and removed returns and parameter
* added cript_api as parameter to all api tests
* added more tests that were needed such as
    * `test_get_db_schema_from_api`
    * `test_get_controlled_vocabulary_from_api`
    * `test_api_search_material_by_uuid`
    * `test_api_material_exact_search`
* added `TODO` for `cript_api` fixture to use from conftest.py

* updated test_api.py with typehints

* updated test_api.py

added `test_create_api`

* updated test_api.py

added 2 tests:
* test_get_my_group_node_from_api
* test_get_my_projects_from_api

* worked on getting full vocabulary from API

* renamed `_load_controlled_vocabulary` to `_get_and_set_vocab`
* worked on `_get_and_set_vocab` to api.py
* initialized `_vocabulary` with empty dict
* added `test_api_http_warning` test_api.py

* updated api.py to get vocabulary from cache if exists

* fixed _get_and_set_vocab cache issue

* updated test_get_db_schema_from_api
* test_get_db_schema_from_api is successful

* updated `get_vocabulary` method and removed test for it

* added `test_is_vocab_valid`

and added Example to `_get_and_set_vocab`

* test_is_vocab_valid successful

* renamed `_get_and_set_vocab` to `get_vocab`

* The user can use the same method to get the vocabulary as it is used by the program
    * less redundancy and less code to maintain
* Tests passing successfully

* updated `InvalidVocabulary` to work correctly

* all tests currently passing

* successfully getting `db_schema`

test_get_db_schema_from_api passing successfully

* worked on `test_get_db_schema_from_api`
* wrote `_get_db_schema` method
* renamed `_schema` to `_db_schema` in api.py
* renamed `_load_db_schema()` to `_get_db_schema()`
* removing TODO for API versioning
    * will just use `v1` for now and will optimize later

* formatted exceptions.py with black

* test_get_db_schema_from_api successful

* wrote `test_get_db_schema_from_api`
* `test_get_db_schema_from_api` is successfully written
* wrote `test_is_node_schema_valid`

* `test_api_with_invalid_host` is successful

* `test_is_node_schema_valid` is failing

* Update api.py

added TODO

* seperated vocabulary categories

* seperated out vocabulary categories into vocabulary_categories.py to keep the code cleaner
    * refactored the api.py file to use vocabulary_categories.py

* reformatted api.py

* reformatted with black

* reformatted and changed function position in test_api.py

* reformatted api.py

moving property to top of class

* test_is_node_schema_valid fail

* created CRIPTAPISaveError for when the node cannot be saved

This exception can be used when the user tries to save their node to the API and the API responds with an http status code that is not `200`
This error code tries to give good errors to the user for easy debugging

* commenting out install.yml for now

* working on api.py `save` method

* commented out delete method

* added comments to test_api.py

* test_api.py formatted with black

* formatted with black `src/cript/api/exceptions.py`

* filled in more of the save method

formatted with black `src/cript/api/api.py`

* updated requirements_dev.txt

updated black and mypy versions
added coverage.py

* updated valid search modes to be what the API has available

* stripping host of spaces

* created InvalidSearchModeError

* added docstrings and formatted api/exceptions.py

* formatted _valid_search_modes.py

* added `_prepare_host` method for cleaning host

* added `_prepare_host` method for cleaning host
* worked on `search` method
    * added docstrings
    * added if statement and started making query

* made `_prepare_host` into a function instead of method

* formatted api.py with black

* updated test_api.py

* reading token from .env file
* wrote function for `test_prepare_host()`
* removed some separate test functions:
    * `test_api_search_material_by_uuid()`
    * `test_api_search_material_by_url()`
    * `test_api_material_exact_search()`

* working on search function

* converted enum to list of strings

* added test comments to test_api.py

* using SearchModes as enum

* added `_get_valid_search_modes()` to api/exceptions.py

updated exceptions.py for InvalidSearchModeError

* no change

* search method is done!

* formatted with black api.py and valid_search_modes.py

* changed available search modes in InvalidSearchModeError

* updated InvalidSearchModeError error message

* updated exceptions.py

* small updates to api.py and test_api.py

* test_prepare_host successful

* stripping url correctly

* current_page_number is a property with getters and setters
* added `fetch_page_from_api()` method

* using url directly as given without the page parameter without needing to prepare it

* refactored paginator name

* instead of `paginator.next()` it will be
`paginator.next_page()` and
`paginator.previous_page()`

* formatted paginator.py with black

* finished paginator but no tests yet

* updated save method to take a Project node

instead of primary node

* host must start with http or https

* added a line for http or https within _prepare_host()
* added an exception for host without http in the name
* tested host exception

* api host putting "/api/v1" inside of host variable

* removing "/api/v1" in other areas to keep the code clean and DRY
    * get_vocab
    * _get_db_schema
    * save
* created a method to check API connection and put place holders
* putting check for api connect towards the end of the init function

* cleaning up _prepare_host assignment to self.host

* updated

* updated `CRIPTAPISaveError` to be more readable and better UX

* cript_api.save working and testing correctly

* added search modes to lib and working on search and paginator

* added SearchModes to library to be easily found
* working on search with paginator, but not done yet
* allowing value_to_search to be None because an empty string just doesn't make sense when writing it

* giving paginator http header instead of token

* removed TODO comment because it is not needed and can be bad design

* save is reset and ready for a real node

* search and paginator working correctly

* added docstrings to paginator.py constructor
* api.save() is using Project type hinting correctly and there are no more circular import errors
* optimized imports and removed unused imports for api
* added an else that raises an error

* reordered arguments for paginator.py because it makes more sense

* search and search_exact I think are doing okay

* putting unsupported methods at the end of api.py

* added comments for tests

* remove print statement

* updated `is_node_schema_valid()` api method

* updated `is_node_schema_valid()` api method started but not tested yet
* worked on CRIPTNodeSchemaError

* reformatted with black

* merging develop into wip_api

* added .converage to .gitignore

* merged `develop` into `wip_api`

* formatted with black

* added node_type property and save is sending correct request to the server

* renamed test project

renamed `test_api_save_material` to `test_api_save_project` since we can only save projects now

* added `SearchModes` and `ExactSearchModes` to package

* removed `get_vocab()` from __init__ to speed up

* api class was very slow because on every api initialization it would get the entire controlled vocabulary when it did not need to do it on initialization and could do it as it was needed

* api search working successfully

* formatted api with black

* formatted test_api.py with black

* search working well, but need to change all classes

* search working well, but need to change all classes

* added `node` to all dataclass of all nodes

* added `node` field to all nodes dataclass to be used when needed by API.search()

* renamed enum from `EXACT_NAME` to `NAME`

* exact search has problem because API answers are not uniform

* formatted material.py with black

* search working fully and well!

--------------------------------------------

Success:
* search works with node type
* search works with contains name
* search works with exact name
* search works with UUID

--------------------------------------------

Notes:
* removed `search_exact` because not needed
* removed `ExactSearch` enum because not needed anymore. `api.search` handles it all
* broke up tests for search into different search mode tests

* always passing in a page number of 0 because it seems to have no effect on the API, but API docs specify certain places that take page numbers
* paginator currently not raising `InvalidPageRequest` even though in docstrings says that it does

--------------------------------------------

Future:
* Need to add exception handling for a lot of it
* Exceptions need to be nice CRITP exceptions

* formatted with black

* is_node_schema_valid is working correctly!

* is_node_schema_valid is working correctly!

* formatted with black

* tests passing correctly

* `test_prepare_host` successful!
* `test_get_db_schema_from_api` successful!

notes:
* save project not passing anymore because I changed the save method within the API, I will have to come check that later

* removed `"node": "material"` from all nodes dataclass

* Add schema validation to node design

* update api save to test with simple_project_node

* Use class name for `node` attribute (#74)

* use type(self).__name__ for node

* add magic to be able to use node_type for classes and instances to get the node type

---------

Co-authored-by: nh916 <[email protected]>

* removing api methods unsupported by API

* delete()
* get_my_user()
* get_my_groups()
* get_my_projects()

* fixed vocab that was missing return statement

* remove wrong node_type

* formatted with black

* added install.yml again

* formatted with trunk

* optimized imports and removed unused variable

* formatted with trunk

* added rough documentation for API

* changing variable names to what data model stated

* Project: had materia**s** and data model specified material
* Experiment: had citation and the data model specified citation**s**

* formatted docs/api.md with trunk

* changed `check_initial_host_connection` to private

* refactoring and renaming

* api instance is private `_is_vocab_valid` and `is_node_schema_valid`

all tests are passing except 2
1. `api.save()` because of deserialization
2. `api.search()` I assume because there are changes happening to the API

* refactoring and renaming

* api instance is private `_is_vocab_valid` and `is_node_schema_valid`

all tests are passing except 2
1. `api.save()` because of deserialization
2. `api.search()` I assume because there are changes happening to the API

* updated faq.md with more example code

* updated api documentation

* formatted examples docstrings within api search

* added docstrings to Search Modes

* docstrings formatting

* added rough draft documentation of paginator

* removed schema and vocabulary.py functions

* having the schema and vocabulary methods within the global API

* formatted api with black

* formatted faq.md

* formatted with trunk

* updated FAQ

* added more content

* trunk formatted

* separated out the Exceptions

more work is needed to get these to be readable and easy to use, but it is a good start for now

* trunk formatted documentation `.md` files

* removing unused documentation file

* renaming `get_vocab` to `fetch_vocab`

* fix test_node_util

* change token management and add dummy token

* fix experiment

* fix api __enter__

* also make CRIPT_HOST a token

* refine node expectation for api check

* test api with env variables only (we don't have token and host ready otherwise)

* removed test_vocab_and_schema.py

* the vocab and schema are no longer needed as the tests are captured within test_api.py

* fixed error for api

* api tests passing except for save

* commenting out the `api.save()` test

* added exception handling to getting the db_schema

* renaming `fetch_vocab` to `get_vocab`

this way it stays consistent with `get_db`

* updated TODO

* removing developer documentation from docs navbar

* fixed documentation issues for collection.md

* fixed docstrings documentation link

* fixed documentation warnings

for reference and mkdocs.yml

* commenting out api search tests for github

* trunk formatted files

* optimized imports

* try

* windows test

* typo

* remove windows test

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* Check for orphraned nodes (#82)

* first draft to check for orphaned nodes

* simplify logic

* rename variables

* add material inventory check

* add specific exceptions and helper functions

* fix materials_list error

* add test to check the orphan nodes detection

* added more documentation to our FAQ section (#86)

* added more documentation to our FAQ section

* formatted with trunk

* Fix API Exceptions and Write Documentation (#85)

* updated `CRIPTAPIRequiredError`

* renamed it from `CRIPTAPIAccessError` to `CRIPTAPIRequiredError` to make it more self documenting
* added docstrings/documentation for it
* fixed it properly in the code

* update docstrings for `CRIPTAPISaveError`

* cleaned up `InvalidVocabulary` error

* cleaned up `InvalidVocabularyCategory` error

formatted the code as well with black

* updated `InvalidHostError`

* removed `InvalidSearchModeError` class

* optimized imports for api/exceptions.py

* wrote docs and cleaned up `CRIPTConnectionError`

* added docstrings for `InvalidHostError`

* added documentation for `APIError`

* updated docstrings for `CRIPTAPIRequiredError`

* formatted api/exceptions.py with black

* removed all method docstring for cleaner documentation

* changed wording on documentation

* updated documentation

* updating db schema test because db schema updated (#90)

* updated tests and trunk workflow (#103)

* updated packages (#100)

* updated packages

* updated packages

* Update README.md (#112)

* added documentation link to it
* added wiki link to it

* Created CONTRIBUTING.md (#116)

* Create CONTRIBUTING.md

* trunk format

---------

Co-authored-by: Ludwig Schneider <[email protected]>

* created docs_ci_check

* Update requirements_dev.txt

added `pytest==7.3.1` to requirements_dev.txt as it was missing previously

* PR template updated (#99)

* Created Test coverage CI (#140)

* added `pytest-cov` to `requirements_dev.txt`

* wrote test_coverage.yaml

* added trigger to run test_coverage.yaml manually

* update requirements_dev.txt mypy package

* formatted test_coverage.yaml

put on block within a nicer list instead of empty blocks

* added matrix OS and Python Version

* using matrix of ubuntu and only Python 3.7 and 3.11

having a lot of checks for coverage is probably unneeded because all coverage will likely be the same, so just testing on ubuntu will the min and max we support is probably more than enough

* Validate nodes (#78)

* api host putting "/api/v1" inside of host variable

* removing "/api/v1" in other areas to keep the code clean and DRY
    * get_vocab
    * _get_db_schema
    * save
* created a method to check API connection and put place holders
* putting check for api connect towards the end of the init function

* cleaning up _prepare_host assignment to self.host

* updated

* updated `CRIPTAPISaveError` to be more readable and better UX

* cript_api.save working and testing correctly

* added search modes to lib and working on search and paginator

* added SearchModes to library to be easily found
* working on search with paginator, but not done yet
* allowing value_to_search to be None because an empty string just doesn't make sense when writing it

* giving paginator http header instead of token

* removed TODO comment because it is not needed and can be bad design

* save is reset and ready for a real node

* search and paginator working correctly

* added docstrings to paginator.py constructor
* api.save() is using Project type hinting correctly and there are no more circular import errors
* optimized imports and removed unused imports for api
* added an else that raises an error

* reordered arguments for paginator.py because it makes more sense

* search and search_exact I think are doing okay

* putting unsupported methods at the end of api.py

* added comments for tests

* remove print statement

* updated `is_node_schema_valid()` api method

* updated `is_node_schema_valid()` api method started but not tested yet
* worked on CRIPTNodeSchemaError

* reformatted with black

* merging develop into wip_api

* added .converage to .gitignore

* merged `develop` into `wip_api`

* formatted with black

* added node_type property and save is sending correct request to the server

* renamed test project

renamed `test_api_save_material` to `test_api_save_project` since we can only save projects now

* added `SearchModes` and `ExactSearchModes` to package

* removed `get_vocab()` from __init__ to speed up

* api class was very slow because on every api initialization it would get the entire controlled vocabulary when it did not need to do it on initialization and could do it as it was needed

* api search working successfully

* formatted api with black

* formatted test_api.py with black

* search working well, but need to change all classes

* search working well, but need to change all classes

* added `node` to all dataclass of all nodes

* added `node` field to all nodes dataclass to be used when needed by API.search()

* renamed enum from `EXACT_NAME` to `NAME`

* exact search has problem because API answers are not uniform

* formatted material.py with black

* search working fully and well!

--------------------------------------------

Success:
* search works with node type
* search works with contains name
* search works with exact name
* search works with UUID

--------------------------------------------

Notes:
* removed `search_exact` because not needed
* removed `ExactSearch` enum because not needed anymore. `api.search` handles it all
* broke up tests for search into different search mode tests

* always passing in a page number of 0 because it seems to have no effect on the API, but API docs specify certain places that take page numbers
* paginator currently not raising `InvalidPageRequest` even though in docstrings says that it does

--------------------------------------------

Future:
* Need to add exception handling for a lot of it
* Exceptions need to be nice CRITP exceptions

* formatted with black

* is_node_schema_valid is working correctly!

* is_node_schema_valid is working correctly!

* formatted with black

* tests passing correctly

* `test_prepare_host` successful!
* `test_get_db_schema_from_api` successful!

notes:
* save project not passing anymore because I changed the save method within the API, I will have to come check that later

* removed `"node": "material"` from all nodes dataclass

* Add schema validation to node design

* update api save to test with simple_project_node

* Use class name for `node` attribute (#74)

* use type(self).__name__ for node

* add magic to be able to use node_type for classes and instances to get the node type

---------

Co-authored-by: nh916 <[email protected]>

* removing api methods unsupported by API

* delete()
* get_my_user()
* get_my_groups()
* get_my_projects()

* fixed vocab that was missing return statement

* remove wrong node_type

* formatted with black

* added install.yml again

* formatted with trunk

* optimized imports and removed unused variable

* formatted with trunk

* added rough documentation for API

* changing variable names to what data model stated

* Project: had materia**s** and data model specified material
* Experiment: had citation and the data model specified citation**s**

* formatted docs/api.md with trunk

* changed `check_initial_host_connection` to private

* refactoring and renaming

* api instance is private `_is_vocab_valid` and `is_node_schema_valid`

all tests are passing except 2
1. `api.save()` because of deserialization
2. `api.search()` I assume because there are changes happening to the API

* refactoring and renaming

* api instance is private `_is_vocab_valid` and `is_node_schema_valid`

all tests are passing except 2
1. `api.save()` because of deserialization
2. `api.search()` I assume because there are changes happening to the API

* updated faq.md with more example code

* updated api documentation

* formatted examples docstrings within api search

* added docstrings to Search Modes

* docstrings formatting

* added rough draft documentation of paginator

* removed schema and vocabulary.py functions

* having the schema and vocabulary methods within the global API

* formatted api with black

* formatted faq.md

* formatted with trunk

* updated FAQ

* added more content

* trunk formatted

* separated out the Exceptions

more work is needed to get these to be readable and easy to use, but it is a good start for now

* trunk formatted documentation `.md` files

* removing unused documentation file

* renaming `get_vocab` to `fetch_vocab`

* fix test_node_util

* change token management and add dummy token

* fix experiment

* fix api __enter__

* also make CRIPT_HOST a token

* refine node expectation for api check

* test api with env variables only (we don't have token and host ready otherwise)

* removed test_vocab_and_schema.py

* the vocab and schema are no longer needed as the tests are captured within test_api.py

* fixed error for api

* api tests passing except for save

* add auto node validation

* fix inventory

* prefix process

* fix material identifiers

* commenting out the `api.save()` test

* fixup material

* fix author

* enough fixing for now

* added exception handling to getting the db_schema

* renaming `fetch_vocab` to `get_vocab`

this way it stays consistent with `get_db`

* updated TODO

* removing developer documentation from docs navbar

* fixed documentation issues for collection.md

* fixed docstrings documentation link

* fixed documentation warnings

for reference and mkdocs.yml

* trunk fix

* add missing s's

* revert type thing

* computational forcefield

* making some progess on test_nodes_util.py

* fix computational forcefield

* remove material keyword validation

* some initial uuid work

* fixed typo

* updated collection, and tests passing!

* reference tests successful!

* project tests passing successfully!

* removing extra parameters in `test_create_simple_experiment`

* `complex_quantity_node` fixed `uncertainty_type`

`uncertainty_type` was incorrect vocabulary "std" is invalid vocabulary

* Quantity `uncertainty` must be str

* first 2 `computational_process` tests passing

* draft uuid base node

* inheritance design for uuid and url

* intermediate step

* optimze search

* fix search errror

* added `simple_computational_process_node`

* move material property to the end to avoid overwriting it

* all experiment tests passing!

* importing `simple_computational_process_node` fixture

* computation tests successful!

* data node tests successful!

* flattened identifiers successfully!

* added `simple_computational_forcefield_node`

* added `simple_computational_forcefield_node` to import

* material first 2 tests passing

test_create_simple_material
test_all_get…
  • Loading branch information
4 people authored Aug 12, 2023
1 parent 2b72f30 commit ad7bcbf
Show file tree
Hide file tree
Showing 158 changed files with 18,937 additions and 13 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/simple-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Simple Issue
about: Describe the issue
title:
labels: ""
assignees: ""
---

## Description
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Description

## Changes

## Tests

## Known Issues

## Notes

## Checklist

- [ ] My name is on the list of contributors (`CONTRIBUTORS.md`) in the pull request source branch.
- [ ] I have updated the documentation to reflect my changes.
21 changes: 21 additions & 0 deletions .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build docs from master branch and push to gh-pages branch to be deployed to repository GitHub pages

name: Build & Deploy Docs
on:
push:
branches:
- develop

# trunk-ignore(yamllint/empty-values)
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install -r requirements_docs.txt
- run: mkdocs gh-deploy --force
78 changes: 78 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: CodeQL

on:
push:
branches:
- develop
- main
- trunk-merge/**
pull_request:
# The branches below must be a subset of the branches above
branches: [develop]
schedule:
- cron: 19 15 * * 2

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [python]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: /language:${{matrix.language}}
28 changes: 28 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: Dependency Review
on:
push:
branches:
- main
- develop
pull_request:
branches:
- develop
- main

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Dependency Review
uses: actions/dependency-review-action@v2
38 changes: 38 additions & 0 deletions .github/workflows/docs_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# this CI workflow checks the documentation for any broken links or errors within documentation files/configuration
# and reports errors to catch errors and never deploy broken documentation
name: MkDocs CI Check

on:
push:
branches:
- main
- develop
- "*"
- trunk-merge/**
pull_request:
branches:
- main
- develop
- "*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set Up Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: Install Python SDK
run: pip install -e .

- name: Install Doc Dependencies
run: pip install -r requirements_docs.txt

- name: Build and Test Documentation
run: mkdocs build
40 changes: 40 additions & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# check code types with mypy to be sure the static types are correct and make sense

name: MyPy Check

on:
push:
branches:
- main
- develop
- trunk-merge/**
pull_request:
branches:
- main
- develop

jobs:
mypy-test:
strategy:
matrix:
python-version: [3.11]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Check out code
uses: actions/checkout@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Run MyPy
run: mypy src/cript/
49 changes: 49 additions & 0 deletions .github/workflows/test_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# use pytest-cov to see what percentage of the code is being covered by tests
# WARNING: this workflow will fail if any of the tests within it fail

name: Test Coverage

on:
push:
branches:
- main
- develop
- trunk-merge/**
pull_request:
branches:
- main
- develop

jobs:
test-coverage:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.11]

env:
CRIPT_HOST: https://lb-stage.mycriptapp.org/
CRIPT_TOKEN: 125433546
CRIPT_STORAGE_TOKEN: 987654321
CRIPT_TESTS: False

steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.11

- name: upgrade pip
run: pip install --upgrade pip

- name: Install CRIPT Python SDK
run: pip install -e .

- name: Install requirements_dev.txt
run: pip install -r requirements_dev.txt

- name: Test Coverage
run: pytest --cov --cov-fail-under=89
46 changes: 46 additions & 0 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Test Jupyter Notebook

on:
push:
branches:
- main
- develop
- trunk-merge/**
pull_request:
branches:
- main
- develop

jobs:
test-examples:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.11]

env:
CRIPT_HOST: https://lb-stage.mycriptapp.org/
CRIPT_TOKEN: 123456789
CRIPT_STORAGE_TOKEN: 987654321

steps:
- name: Checkout
uses: actions/checkout@v3

- name: install test dependency
run: python3 -m pip install -r requirements_docs.txt

- name: install module
run: python3 -m pip install .

- name: prepare notebook
run: |
jupytext --to py docs/examples/synthesis.md
jupytext --to py docs/examples/simulation.md
- name: Run script
run: |
python3 docs/examples/synthesis.py
python3 docs/examples/simulation.py
Loading

0 comments on commit ad7bcbf

Please sign in to comment.