Skip to content

Commit

Permalink
Small corrections (#1562)
Browse files Browse the repository at this point in the history
* Removed unnecessary code from showwarning method.

* Added type hint for failure_type

* Replaced reference to Heroku server with a reference to the Fly server in validation.md.

* Added python 3.11 to setup.py.

* Added validate-query_parameters and validate_api_response flags and removed config_file field from default config example.

* Updated mentioned Elasticsearch version on line 101 INSTALL.md.

* Increased sleep time for elastic search in instructions INSTALL.md.

Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com>

---------

Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com>
  • Loading branch information
JPBergsma and ml-evs committed Mar 16, 2023
1 parent d5e7c15 commit 88166c7
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 87 deletions.
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ The easiest way to deploy these databases and run the tests is with Docker, as s
[Docker installation instructions](https://docs.docker.com/engine/install/) will depend on your system; on Linux, the `docker` commands below may need to be prepended with `sudo`, depending on your distribution.
These commands should be run from a local optimade-python-tools directory.

The following command starts a local Elasticsearch v6 instance, runs the test suite, then stops and deletes the containers (required as the tests insert some data):
The following command starts a local Elasticsearch v7 instance, runs the test suite, then stops and deletes the containers (required as the tests insert some data):

```shell
docker run -d --name elasticsearch_test -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" elasticsearch:7.17.7 \
&& sleep 10 \
&& sleep 20 \
&& OPTIMADE_DATABASE_BACKEND="elastic" py.test; \
docker container stop elasticsearch_test; docker container rm elasticsearch_test
```
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The validator is implemented in the [`optimade.validator`][optimade.validator.va
2. The [`optimade-validator-action`](https://github.com/Materials-Consortia/optimade-validator-action) which allows the validator to be used as a GitHub Action.

To run the script, simply provide an OPTIMADE URL to the script at the command-line.
You can use the following to validate the Heroku deployment of our reference server:
You can use the following to validate the Fly deployment of our reference server:

```shell
$ optimade-validator https://optimade.fly.dev/
Expand Down
5 changes: 3 additions & 2 deletions docs/static/default_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"config_file": "~/.optimade.json",
"debug": false,
"insert_test_data": true,
"mongo_database": "optimade",
Expand Down Expand Up @@ -29,5 +28,7 @@
"length_aliases": {},
"index_links_path": "./optimade/server/index_links.json",
"log_level": "info",
"log_dir": "/var/log/optimade/"
"log_dir": "/var/log/optimade/",
"validate_query_parameters": true,
"validate_api_response": true
}
16 changes: 8 additions & 8 deletions openapi/index_openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,15 +505,15 @@
"title": "Id",
"type": "string",
"description": "An entry's ID as defined in section Definition of Terms.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: MUST be supported by all implementations, MUST NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response.\n\n- **Examples**:\n - `\"db/1234567\"`\n - `\"cod/2000000\"`\n - `\"cod/2000000@1234567\"`\n - `\"nomad/L1234567890\"`\n - `\"42\"`",
"x-optimade-support": "must",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "must"
},
"type": {
"title": "Type",
"type": "string",
"description": "The name of the type of an entry.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: MUST be supported by all implementations, MUST NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response.\n - MUST be an existing entry type.\n - The entry of type `<type>` and ID `<id>` MUST be returned in response to a request for `/<type>/<id>` under the versioned base URL.\n\n- **Example**: `\"structures\"`",
"x-optimade-support": "must",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "must"
},
"links": {
"title": "Links",
Expand Down Expand Up @@ -565,8 +565,8 @@
"title": "Immutable Id",
"type": "string",
"description": "The entry's immutable ID (e.g., an UUID). This is important for databases having preferred IDs that point to \"the latest version\" of a record, but still offer access to older variants. This ID maps to the version-specific record, in case it changes in the future.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: OPTIONAL support in implementations, i.e., MAY be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n\n- **Examples**:\n - `\"8bd3e750-b477-41a0-9b11-3a799f21b44f\"`\n - `\"fjeiwoj,54;@=%<>#32\"` (Strings that are not URL-safe are allowed.)",
"x-optimade-support": "optional",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "optional"
},
"last_modified": {
"title": "Last Modified",
Expand Down Expand Up @@ -1114,8 +1114,8 @@
"title": "Id",
"type": "string",
"description": "An entry's ID as defined in section Definition of Terms.\n\n- **Type**: string.\n\n- **Requirements/Conventions**:\n - **Support**: MUST be supported by all implementations, MUST NOT be `null`.\n - **Query**: MUST be a queryable property with support for all mandatory filter features.\n - **Response**: REQUIRED in the response.\n\n- **Examples**:\n - `\"db/1234567\"`\n - `\"cod/2000000\"`\n - `\"cod/2000000@1234567\"`\n - `\"nomad/L1234567890\"`\n - `\"42\"`",
"x-optimade-support": "must",
"x-optimade-queryable": "must"
"x-optimade-queryable": "must",
"x-optimade-support": "must"
},
"type": {
"title": "Type",
Expand Down

0 comments on commit 88166c7

Please sign in to comment.