bigraph-schema 0.0.54__tar.gz → 0.0.56__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of bigraph-schema might be problematic. Click here for more details.
- {bigraph-schema-0.0.54/bigraph_schema.egg-info → bigraph-schema-0.0.56}/PKG-INFO +1 -1
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/edge.py +10 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/type_functions.py +144 -7
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/type_system.py +1 -11
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56/bigraph_schema.egg-info}/PKG-INFO +1 -1
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema.egg-info/SOURCES.txt +1 -15
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/setup.py +1 -1
- bigraph-schema-0.0.54/.github/workflows/notebook_to_html.yml +0 -48
- bigraph-schema-0.0.54/.github/workflows/pytest.yml +0 -29
- bigraph-schema-0.0.54/.gitignore +0 -14
- bigraph-schema-0.0.54/CLA.md +0 -113
- bigraph-schema-0.0.54/CODE_OF_CONDUCT.md +0 -137
- bigraph-schema-0.0.54/CONTRIBUTING.md +0 -44
- bigraph-schema-0.0.54/notebooks/core.ipynb +0 -1683
- bigraph-schema-0.0.54/notebooks/demo.ipynb +0 -1487
- bigraph-schema-0.0.54/notebooks/images/place-link.png +0 -0
- bigraph-schema-0.0.54/notebooks/images/reaction-after.png +0 -0
- bigraph-schema-0.0.54/notebooks/images/reaction-before.png +0 -0
- bigraph-schema-0.0.54/notebooks/images/redex-reactum.png +0 -0
- bigraph-schema-0.0.54/pytest.ini +0 -4
- bigraph-schema-0.0.54/release.sh +0 -43
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/AUTHORS.md +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/LICENSE +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/README.md +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/__init__.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/parse.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/protocols.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/registry.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/type_system_tests.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/units.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema/utilities.py +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema.egg-info/dependency_links.txt +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema.egg-info/requires.txt +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/bigraph_schema.egg-info/top_level.txt +0 -0
- {bigraph-schema-0.0.54 → bigraph-schema-0.0.56}/setup.cfg +0 -0
|
@@ -31,6 +31,16 @@ class Edge:
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
def initial_state(self):
|
|
34
|
+
"""The initial state of the edge, which is passed to the core."""
|
|
35
|
+
return {}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@staticmethod
|
|
39
|
+
def generate_state(config=None): # TODO -- config could have a schema
|
|
40
|
+
"""
|
|
41
|
+
Generate an initial state statically, without any instance-specific config.
|
|
42
|
+
This could be used to create user-configured initial states based on the Edge's requirements.
|
|
43
|
+
"""
|
|
34
44
|
return {}
|
|
35
45
|
|
|
36
46
|
|
|
@@ -75,6 +75,7 @@ import typing
|
|
|
75
75
|
from typing import NewType, Union, Mapping, List, Dict, Optional, Callable
|
|
76
76
|
from dataclasses import field, make_dataclass
|
|
77
77
|
|
|
78
|
+
from bigraph_schema import get_path, set_path
|
|
78
79
|
from bigraph_schema.units import units, render_units_type
|
|
79
80
|
from bigraph_schema.registry import (
|
|
80
81
|
is_schema_key, non_schema_keys, type_parameter_key, deep_merge, hierarchy_depth, establish_path
|
|
@@ -1083,8 +1084,50 @@ def serialize_edge(schema, value, core):
|
|
|
1083
1084
|
def serialize_enum(schema, value, core):
|
|
1084
1085
|
return value
|
|
1085
1086
|
|
|
1087
|
+
def recur_serialize_schema(schema, core, path=None, parents=None):
|
|
1088
|
+
""" Serialize schema to a string """
|
|
1089
|
+
path = path or []
|
|
1090
|
+
parents = parents or []
|
|
1091
|
+
schema_id = id(schema)
|
|
1092
|
+
|
|
1093
|
+
if schema_id in parents:
|
|
1094
|
+
index = parents.index(schema_id)
|
|
1095
|
+
reference = path[:index]
|
|
1096
|
+
output = '/'.join(reference)
|
|
1097
|
+
return f'/{output}'
|
|
1098
|
+
|
|
1099
|
+
if isinstance(schema, str):
|
|
1100
|
+
return schema
|
|
1101
|
+
|
|
1102
|
+
elif isinstance(schema, tuple):
|
|
1103
|
+
inner = [
|
|
1104
|
+
recur_serialize_schema(
|
|
1105
|
+
schema=element,
|
|
1106
|
+
core=core,
|
|
1107
|
+
path=path+[index],
|
|
1108
|
+
parents=parents+[schema_id])
|
|
1109
|
+
for index, element in enumerate(schema)]
|
|
1110
|
+
|
|
1111
|
+
return inner
|
|
1112
|
+
|
|
1113
|
+
elif isinstance(schema, dict):
|
|
1114
|
+
inner = {}
|
|
1115
|
+
for key in schema:
|
|
1116
|
+
subschema = recur_serialize_schema(
|
|
1117
|
+
schema=schema[key],
|
|
1118
|
+
core=core,
|
|
1119
|
+
path=path+[key],
|
|
1120
|
+
parents=parents+[schema_id])
|
|
1121
|
+
inner[key] = subschema
|
|
1122
|
+
|
|
1123
|
+
return inner
|
|
1124
|
+
|
|
1125
|
+
else:
|
|
1126
|
+
return schema
|
|
1127
|
+
|
|
1086
1128
|
def serialize_schema(schema, state, core):
|
|
1087
|
-
|
|
1129
|
+
""" Serialize schema to a string """
|
|
1130
|
+
return recur_serialize_schema(schema=state, core=core)
|
|
1088
1131
|
|
|
1089
1132
|
def serialize_array(schema, value, core):
|
|
1090
1133
|
""" Serialize numpy array to list """
|
|
@@ -1229,6 +1272,9 @@ def deserialize_maybe(schema, encoded, core):
|
|
|
1229
1272
|
|
|
1230
1273
|
return core.deserialize(value_type, encoded)
|
|
1231
1274
|
|
|
1275
|
+
def deserialize_quote(schema, state, core):
|
|
1276
|
+
return state
|
|
1277
|
+
|
|
1232
1278
|
def deserialize_boolean(schema, encoded, core) -> bool:
|
|
1233
1279
|
if encoded == 'true':
|
|
1234
1280
|
return True
|
|
@@ -1313,8 +1359,52 @@ def deserialize_array(schema, encoded, core):
|
|
|
1313
1359
|
def deserialize_edge(schema, encoded, core):
|
|
1314
1360
|
return encoded
|
|
1315
1361
|
|
|
1362
|
+
def recur_deserialize_schema(schema, core, top_state=None, path=None):
|
|
1363
|
+
top_state = top_state or schema
|
|
1364
|
+
path = path or []
|
|
1365
|
+
|
|
1366
|
+
if isinstance(schema, dict):
|
|
1367
|
+
subschema = {}
|
|
1368
|
+
for key, value in schema.items():
|
|
1369
|
+
subschema[key] = recur_deserialize_schema(
|
|
1370
|
+
value,
|
|
1371
|
+
core,
|
|
1372
|
+
top_state=top_state,
|
|
1373
|
+
path=path+[key])
|
|
1374
|
+
|
|
1375
|
+
return subschema
|
|
1376
|
+
|
|
1377
|
+
elif isinstance(schema, list):
|
|
1378
|
+
subschema = []
|
|
1379
|
+
for index, value in enumerate(schema):
|
|
1380
|
+
subschema.append(
|
|
1381
|
+
recur_deserialize_schema(
|
|
1382
|
+
value,
|
|
1383
|
+
core,
|
|
1384
|
+
top_state=top_state,
|
|
1385
|
+
path=path+[index]))
|
|
1386
|
+
|
|
1387
|
+
return tuple(subschema)
|
|
1388
|
+
|
|
1389
|
+
elif isinstance(schema, str):
|
|
1390
|
+
if schema.startswith('/'): # this is a reference to another schema
|
|
1391
|
+
local_path = schema.split('/')[1:]
|
|
1392
|
+
reference = get_path(top_state, local_path)
|
|
1393
|
+
|
|
1394
|
+
set_path(
|
|
1395
|
+
tree=top_state,
|
|
1396
|
+
path=path,
|
|
1397
|
+
value=reference)
|
|
1398
|
+
|
|
1399
|
+
return reference
|
|
1400
|
+
else:
|
|
1401
|
+
return schema
|
|
1402
|
+
else:
|
|
1403
|
+
return schema
|
|
1404
|
+
|
|
1405
|
+
|
|
1316
1406
|
def deserialize_schema(schema, state, core):
|
|
1317
|
-
return state
|
|
1407
|
+
return recur_deserialize_schema(schema=state, core=core)
|
|
1318
1408
|
|
|
1319
1409
|
|
|
1320
1410
|
# =========================
|
|
@@ -1366,7 +1456,7 @@ def slice_any(schema, state, path, core):
|
|
|
1366
1456
|
|
|
1367
1457
|
step = state[head]
|
|
1368
1458
|
|
|
1369
|
-
elif hasattr(state, head):
|
|
1459
|
+
elif isinstance(head, str) and hasattr(state, head):
|
|
1370
1460
|
step = getattr(state, head)
|
|
1371
1461
|
|
|
1372
1462
|
if head in schema:
|
|
@@ -1548,6 +1638,8 @@ def slice_array(schema, state, path, core):
|
|
|
1548
1638
|
if len(path) > 0:
|
|
1549
1639
|
head = path[0]
|
|
1550
1640
|
tail = path[1:]
|
|
1641
|
+
if isinstance(head, str):
|
|
1642
|
+
head = int(head)
|
|
1551
1643
|
step = state[head]
|
|
1552
1644
|
|
|
1553
1645
|
if isinstance(step, np.ndarray):
|
|
@@ -1624,6 +1716,15 @@ def bind_enum(schema, state, key, subschema, substate, core):
|
|
|
1624
1716
|
|
|
1625
1717
|
return new_schema, tuple(open)
|
|
1626
1718
|
|
|
1719
|
+
def bind_array(schema, state, key, subschema, substate, core):
|
|
1720
|
+
if state is None:
|
|
1721
|
+
state = core.default(schema)
|
|
1722
|
+
if isinstance(key, str):
|
|
1723
|
+
key = int(key)
|
|
1724
|
+
state[key] = substate
|
|
1725
|
+
|
|
1726
|
+
return schema, state
|
|
1727
|
+
|
|
1627
1728
|
|
|
1628
1729
|
# ==========================
|
|
1629
1730
|
# Resolve Functions Overview
|
|
@@ -2050,6 +2151,8 @@ def generate_any(core, schema, state, top_schema=None, top_state=None, path=None
|
|
|
2050
2151
|
generated_state)
|
|
2051
2152
|
|
|
2052
2153
|
else:
|
|
2154
|
+
if not core.check(schema, state):
|
|
2155
|
+
state = core.deserialize(schema, state)
|
|
2053
2156
|
generated_schema, generated_state = schema, state
|
|
2054
2157
|
|
|
2055
2158
|
return generated_schema, generated_state, top_schema, top_state
|
|
@@ -2065,10 +2168,6 @@ def default_quote(schema, core):
|
|
|
2065
2168
|
return None
|
|
2066
2169
|
|
|
2067
2170
|
|
|
2068
|
-
def deserialize_quote(schema, state, core):
|
|
2069
|
-
return state
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
2171
|
def generate_map(core, schema, state, top_schema=None, top_state=None, path=None):
|
|
2073
2172
|
schema = schema or {}
|
|
2074
2173
|
state = state or core.default(schema)
|
|
@@ -2311,9 +2410,45 @@ def sort_any(core, schema, state):
|
|
|
2311
2410
|
|
|
2312
2411
|
return merged_schema, merged_state
|
|
2313
2412
|
|
|
2413
|
+
|
|
2314
2414
|
def sort_quote(core, schema, state):
|
|
2315
2415
|
return schema, state
|
|
2316
2416
|
|
|
2417
|
+
|
|
2418
|
+
def sort_map(core, schema, state):
|
|
2419
|
+
if not isinstance(schema, dict):
|
|
2420
|
+
schema = core.find(schema)
|
|
2421
|
+
if not isinstance(state, dict):
|
|
2422
|
+
return schema, state
|
|
2423
|
+
|
|
2424
|
+
merged_schema = {}
|
|
2425
|
+
merged_state = {}
|
|
2426
|
+
|
|
2427
|
+
value_schema = core.find_parameter(
|
|
2428
|
+
schema,
|
|
2429
|
+
'value')
|
|
2430
|
+
|
|
2431
|
+
for key in union_keys(schema, state):
|
|
2432
|
+
if is_schema_key(key):
|
|
2433
|
+
if key in state:
|
|
2434
|
+
merged_schema[key] = core.merge_schemas(
|
|
2435
|
+
schema.get(key, {}),
|
|
2436
|
+
state[key])
|
|
2437
|
+
else:
|
|
2438
|
+
merged_schema[key] = schema[key]
|
|
2439
|
+
else:
|
|
2440
|
+
subschema, merged_state[key] = core.sort(
|
|
2441
|
+
schema.get(key, {}),
|
|
2442
|
+
state.get(key, None))
|
|
2443
|
+
if subschema:
|
|
2444
|
+
value_schema = core.merge_schemas(
|
|
2445
|
+
value_schema,
|
|
2446
|
+
subschema)
|
|
2447
|
+
# merged_schema[key] = subschema
|
|
2448
|
+
|
|
2449
|
+
return merged_schema, merged_state
|
|
2450
|
+
|
|
2451
|
+
|
|
2317
2452
|
def find_union_type(core, schema, state):
|
|
2318
2453
|
parameters = core.parameters_for(schema)
|
|
2319
2454
|
|
|
@@ -2573,6 +2708,7 @@ base_types = {
|
|
|
2573
2708
|
'_slice': slice_map,
|
|
2574
2709
|
'_fold': fold_map,
|
|
2575
2710
|
'_divide': divide_map,
|
|
2711
|
+
'_sort': sort_map,
|
|
2576
2712
|
'_type_parameters': ['value'],
|
|
2577
2713
|
'_description': 'flat mapping from keys of strings to values of any type'},
|
|
2578
2714
|
|
|
@@ -2602,6 +2738,7 @@ base_types = {
|
|
|
2602
2738
|
'_deserialize': deserialize_array,
|
|
2603
2739
|
'_dataclass': dataclass_array,
|
|
2604
2740
|
'_resolve': resolve_array,
|
|
2741
|
+
'_bind': bind_array,
|
|
2605
2742
|
'_type_parameters': [
|
|
2606
2743
|
'shape',
|
|
2607
2744
|
'data'],
|
|
@@ -349,20 +349,10 @@ class TypeSystem(Registry):
|
|
|
349
349
|
registry_type = self.retrieve(
|
|
350
350
|
schema['_type'])
|
|
351
351
|
|
|
352
|
-
# found = self.resolve(
|
|
353
|
-
# registry_type,
|
|
354
|
-
# schema)
|
|
355
|
-
|
|
356
352
|
found = self.merge_schemas(
|
|
357
353
|
registry_type,
|
|
358
354
|
schema)
|
|
359
355
|
|
|
360
|
-
# found = schema.copy()
|
|
361
|
-
|
|
362
|
-
# for key, value in registry_type.items():
|
|
363
|
-
# if key == '_type' or key not in found:
|
|
364
|
-
# found[key] = value
|
|
365
|
-
|
|
366
356
|
else:
|
|
367
357
|
found = {
|
|
368
358
|
key: self.access(
|
|
@@ -1610,7 +1600,7 @@ class TypeSystem(Registry):
|
|
|
1610
1600
|
if inner_view is not None:
|
|
1611
1601
|
result[port_key] = inner_view
|
|
1612
1602
|
else:
|
|
1613
|
-
raise Exception(f'trying to
|
|
1603
|
+
raise Exception(f'trying to view state with these ports:\n{schema}\nbut not sure what these wires are:\n{wires}')
|
|
1614
1604
|
|
|
1615
1605
|
return result
|
|
1616
1606
|
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
.gitignore
|
|
2
1
|
AUTHORS.md
|
|
3
|
-
CLA.md
|
|
4
|
-
CODE_OF_CONDUCT.md
|
|
5
|
-
CONTRIBUTING.md
|
|
6
2
|
LICENSE
|
|
7
3
|
README.md
|
|
8
|
-
pytest.ini
|
|
9
|
-
release.sh
|
|
10
4
|
setup.py
|
|
11
|
-
.github/workflows/notebook_to_html.yml
|
|
12
|
-
.github/workflows/pytest.yml
|
|
13
5
|
bigraph_schema/__init__.py
|
|
14
6
|
bigraph_schema/edge.py
|
|
15
7
|
bigraph_schema/parse.py
|
|
@@ -24,10 +16,4 @@ bigraph_schema.egg-info/PKG-INFO
|
|
|
24
16
|
bigraph_schema.egg-info/SOURCES.txt
|
|
25
17
|
bigraph_schema.egg-info/dependency_links.txt
|
|
26
18
|
bigraph_schema.egg-info/requires.txt
|
|
27
|
-
bigraph_schema.egg-info/top_level.txt
|
|
28
|
-
notebooks/core.ipynb
|
|
29
|
-
notebooks/demo.ipynb
|
|
30
|
-
notebooks/images/place-link.png
|
|
31
|
-
notebooks/images/reaction-after.png
|
|
32
|
-
notebooks/images/reaction-before.png
|
|
33
|
-
notebooks/images/redex-reactum.png
|
|
19
|
+
bigraph_schema.egg-info/top_level.txt
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
name: Convert Jupyter Notebook to HTML
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
paths:
|
|
6
|
-
- 'notebooks/demo.ipynb'
|
|
7
|
-
- 'notebooks/core.ipynb'
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
convert:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Check out repository
|
|
14
|
-
uses: actions/checkout@main
|
|
15
|
-
with:
|
|
16
|
-
ref: main
|
|
17
|
-
fetch-depth: 0 # Fetch all history to have access to the gh-pages branch
|
|
18
|
-
|
|
19
|
-
- name: Set up Python
|
|
20
|
-
uses: actions/setup-python@main
|
|
21
|
-
with:
|
|
22
|
-
python-version: 3.x
|
|
23
|
-
|
|
24
|
-
- name: Install dependencies
|
|
25
|
-
run: |
|
|
26
|
-
python -m pip install --upgrade pip
|
|
27
|
-
pip install nbconvert
|
|
28
|
-
|
|
29
|
-
- name: Convert Jupyter Notebook to HTML
|
|
30
|
-
run: |
|
|
31
|
-
jupyter nbconvert --to html notebooks/demo.ipynb
|
|
32
|
-
jupyter nbconvert --to html notebooks/core.ipynb
|
|
33
|
-
|
|
34
|
-
- name: Commit and push HTML to gh-pages branch
|
|
35
|
-
run: |
|
|
36
|
-
git config --local user.email "eagmon@github.com"
|
|
37
|
-
git config --local user.name "GitHub Action"
|
|
38
|
-
git fetch origin
|
|
39
|
-
mv notebooks/demo.html /tmp/demo.html
|
|
40
|
-
mv notebooks/core.html /tmp/core.html
|
|
41
|
-
git checkout gh-pages || git checkout -b gh-pages
|
|
42
|
-
git pull origin gh-pages
|
|
43
|
-
mv /tmp/demo.html notebooks/demo.html
|
|
44
|
-
mv /tmp/core.html notebooks/core.html
|
|
45
|
-
git add notebooks/demo.html
|
|
46
|
-
git add notebooks/core.html
|
|
47
|
-
git diff-index --quiet HEAD || git commit -m "Update HTML files"
|
|
48
|
-
git push origin gh-pages || true
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
name: Run Pytest
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
test:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- name: Check out repository
|
|
13
|
-
uses: actions/checkout@v2
|
|
14
|
-
|
|
15
|
-
- name: Set up Python
|
|
16
|
-
uses: actions/setup-python@v2
|
|
17
|
-
with:
|
|
18
|
-
python-version: 3.x
|
|
19
|
-
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: |
|
|
22
|
-
python -m pip install --upgrade pip
|
|
23
|
-
pip install pytest pytest-cov
|
|
24
|
-
pip install -e .
|
|
25
|
-
|
|
26
|
-
- name: Run pytest
|
|
27
|
-
run: |
|
|
28
|
-
pip install pytest
|
|
29
|
-
pytest --cov=bigraph_schema --cov-report=term
|
bigraph-schema-0.0.54/.gitignore
DELETED
bigraph-schema-0.0.54/CLA.md
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Individual Contributor License Agreement
|
|
2
|
-
|
|
3
|
-
Thank you for your interest in Vivarium Core. To clarify the
|
|
4
|
-
intellectual property license granted with Contributions from any person
|
|
5
|
-
or entity, each Contribution must indicate each Contributor's agreement
|
|
6
|
-
with the license terms below. This agreement is for your protection as a
|
|
7
|
-
Contributor as well as the protection of the Vivarium Core authors
|
|
8
|
-
(Authors) and Vivarium Core's users. It does not change your rights to
|
|
9
|
-
use your own Contributions for any other purpose.
|
|
10
|
-
|
|
11
|
-
You accept and agree to the following terms and conditions for Your
|
|
12
|
-
Contributions (present and future) that you submit to the Authors.
|
|
13
|
-
Except for the license granted herein to the Authors and recipients of
|
|
14
|
-
software distributed by the Authors, You reserve all right, title, and
|
|
15
|
-
interest in and to Your Contributions.
|
|
16
|
-
|
|
17
|
-
1. Definitions
|
|
18
|
-
|
|
19
|
-
"You" (or "Your") shall mean the copyright owner or legal entity
|
|
20
|
-
authorized by the copyright owner that is making this Agreement with
|
|
21
|
-
the Authors. For legal entities, the entity making a Contribution and
|
|
22
|
-
all other entities that control, are controlled by, or are under
|
|
23
|
-
common control with that entity are considered to be a single
|
|
24
|
-
Contributor. For the purposes of this definition, "control" means (i)
|
|
25
|
-
the power, direct or indirect, to cause the direction or management
|
|
26
|
-
of such entity, whether by contract or otherwise, or (ii) ownership
|
|
27
|
-
of fifty percent (50%) or more of the outstanding shares, or (iii)
|
|
28
|
-
beneficial ownership of such entity.
|
|
29
|
-
|
|
30
|
-
"Contribution" shall mean any original work of authorship, including
|
|
31
|
-
any modifications or additions to an existing work, that is
|
|
32
|
-
intentionally submitted by You to the Authors for inclusion in, or
|
|
33
|
-
documentation of, any of the products owned or managed by the Authors
|
|
34
|
-
(the "Work"). For the purposes of this definition, "submitted" means
|
|
35
|
-
any form of electronic, verbal, or written communication sent to the
|
|
36
|
-
Authors or their representatives, including but not limited to
|
|
37
|
-
communication on electronic mailing lists, source code control
|
|
38
|
-
systems, and issue tracking systems that are managed by, or on behalf
|
|
39
|
-
of, the Authors for the purpose of discussing and improving the Work,
|
|
40
|
-
but excluding communication that is conspicuously marked or otherwise
|
|
41
|
-
designated in writing by You as "Not a Contribution."
|
|
42
|
-
|
|
43
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
44
|
-
this Agreement, You hereby grant to the Authors and to recipients
|
|
45
|
-
of software distributed by the Authors a perpetual, worldwide,
|
|
46
|
-
non-exclusive, no-charge, royalty-free, irrevocable copyright license
|
|
47
|
-
to reproduce, prepare derivative works of, publicly display, publicly
|
|
48
|
-
perform, sublicense, and distribute Your Contributions and such
|
|
49
|
-
derivative works.
|
|
50
|
-
|
|
51
|
-
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
52
|
-
Agreement, You hereby grant to the Authors and to recipients of
|
|
53
|
-
software distributed by the Authors a perpetual, worldwide,
|
|
54
|
-
non-exclusive, no-charge, royalty-free, irrevocable (except as stated
|
|
55
|
-
in this section) patent license to make, have made, use, offer to
|
|
56
|
-
sell, sell, import, and otherwise transfer the Work, where such
|
|
57
|
-
license applies only to those patent claims licensable by You that
|
|
58
|
-
are necessarily infringed by Your Contribution(s) alone or by
|
|
59
|
-
combination of Your Contribution(s) with the Work to which such
|
|
60
|
-
Contribution(s) was submitted. If any entity institutes patent
|
|
61
|
-
litigation against You or any other entity (including a cross-claim
|
|
62
|
-
or counterclaim in a lawsuit) alleging that your Contribution, or the
|
|
63
|
-
Work to which you have contributed, constitutes direct or
|
|
64
|
-
contributory patent infringement, then any patent licenses granted to
|
|
65
|
-
that entity under this Agreement for that Contribution or Work shall
|
|
66
|
-
terminate as of the date such litigation is filed.
|
|
67
|
-
|
|
68
|
-
4. You represent that you are legally entitled to grant the above
|
|
69
|
-
license. If your employer(s) has rights to intellectual property that
|
|
70
|
-
you create that includes your Contributions, you represent that you
|
|
71
|
-
have received permission to make Contributions on behalf of that
|
|
72
|
-
employer, that your employer has waived such rights for your
|
|
73
|
-
Contributions to the Authors, or that your employer has executed a
|
|
74
|
-
separate Corporate CLA with the Authors.
|
|
75
|
-
|
|
76
|
-
5. You represent that each of Your Contributions is Your original
|
|
77
|
-
creation (see section 7 for submissions on behalf of others). You
|
|
78
|
-
represent that Your Contribution submissions include complete details
|
|
79
|
-
of any third-party license or other restriction (including, but not
|
|
80
|
-
limited to, related patents and trademarks) of which you are
|
|
81
|
-
personally aware and which are associated with any part of Your
|
|
82
|
-
Contributions.
|
|
83
|
-
|
|
84
|
-
6. You are not expected to provide support for Your Contributions,
|
|
85
|
-
except to the extent You desire to provide support. You may provide
|
|
86
|
-
support for free, for a fee, or not at all. Unless required by
|
|
87
|
-
applicable law or agreed to in writing, You provide Your
|
|
88
|
-
Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
|
89
|
-
OF ANY KIND, either express or implied, including, without
|
|
90
|
-
limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT,
|
|
91
|
-
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
|
92
|
-
|
|
93
|
-
7. Should You wish to submit work that is not Your original creation,
|
|
94
|
-
You may submit it to the Authors separately from any Contribution,
|
|
95
|
-
identifying the complete details of its source and of any license or
|
|
96
|
-
other restriction (including, but not limited to, related patents,
|
|
97
|
-
trademarks, and license agreements) of which you are personally
|
|
98
|
-
aware, and conspicuously marking the work as "Submitted on behalf of
|
|
99
|
-
a third-party: [named here]".
|
|
100
|
-
|
|
101
|
-
8. You agree to notify the Authors of any facts or circumstances of
|
|
102
|
-
which you become aware that would make these representations
|
|
103
|
-
inaccurate in any respect.
|
|
104
|
-
|
|
105
|
-
-----------------------------------------------------------------------
|
|
106
|
-
|
|
107
|
-
End of Contributor License Agreement
|
|
108
|
-
|
|
109
|
-
-----------------------------------------------------------------------
|
|
110
|
-
|
|
111
|
-
The text of this agreement was adapted from the Apache Software
|
|
112
|
-
Foundation's [Individual Contributor License
|
|
113
|
-
Agreement](https://apache.org/licenses/icla.pdf).
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
# Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in
|
|
6
|
-
our community a harassment-free experience for everyone, regardless of
|
|
7
|
-
age, body size, visible or invisible disability, ethnicity, sex
|
|
8
|
-
characteristics, gender identity and expression, level of experience,
|
|
9
|
-
education, socio-economic status, nationality, personal appearance,
|
|
10
|
-
race, caste, color, religion, or sexual identity and orientation.
|
|
11
|
-
|
|
12
|
-
We pledge to act and interact in ways that contribute to an open,
|
|
13
|
-
welcoming, diverse, inclusive, and healthy community.
|
|
14
|
-
|
|
15
|
-
## Our Standards
|
|
16
|
-
|
|
17
|
-
Examples of behavior that contributes to a positive environment for our
|
|
18
|
-
community include:
|
|
19
|
-
|
|
20
|
-
* Demonstrating empathy and kindness toward other people
|
|
21
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
-
* Giving and gracefully accepting constructive feedback
|
|
23
|
-
* Accepting responsibility and apologizing to those affected by our
|
|
24
|
-
mistakes, and learning from the experience
|
|
25
|
-
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
-
overall community
|
|
27
|
-
|
|
28
|
-
Examples of unacceptable behavior include:
|
|
29
|
-
|
|
30
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
-
advances of any kind
|
|
32
|
-
* Trolling, insulting or derogatory comments, and personal or political
|
|
33
|
-
attacks
|
|
34
|
-
* Public or private harassment
|
|
35
|
-
* Publishing others' private information, such as a physical or email
|
|
36
|
-
address, without their explicit permission
|
|
37
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
38
|
-
professional setting
|
|
39
|
-
|
|
40
|
-
## Enforcement Responsibilities
|
|
41
|
-
|
|
42
|
-
Community leaders are responsible for clarifying and enforcing our
|
|
43
|
-
standards of acceptable behavior and will take appropriate and fair
|
|
44
|
-
corrective action in response to any behavior that they deem
|
|
45
|
-
inappropriate, threatening, offensive, or harmful.
|
|
46
|
-
|
|
47
|
-
Community leaders have the right and responsibility to remove, edit, or
|
|
48
|
-
reject comments, commits, code, wiki edits, issues, and other
|
|
49
|
-
contributions that are not aligned to this Code of Conduct, and will
|
|
50
|
-
communicate reasons for moderation decisions when appropriate.
|
|
51
|
-
|
|
52
|
-
## Scope
|
|
53
|
-
|
|
54
|
-
This Code of Conduct applies within all community spaces, and also
|
|
55
|
-
applies when an individual is officially representing the community in
|
|
56
|
-
public spaces. Examples of representing our community include using an
|
|
57
|
-
official e-mail address, posting via an official social media account,
|
|
58
|
-
or acting as an appointed representative at an online or offline event.
|
|
59
|
-
|
|
60
|
-
## Enforcement
|
|
61
|
-
|
|
62
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may
|
|
63
|
-
be reported to the Authors at the email addresses in
|
|
64
|
-
[`AUTHORS.md`](AUTHORS.md). All complaints will be reviewed and
|
|
65
|
-
investigated promptly and fairly.
|
|
66
|
-
|
|
67
|
-
All community leaders are obligated to respect the privacy and security
|
|
68
|
-
of the reporter of any incident.
|
|
69
|
-
|
|
70
|
-
## Enforcement Guidelines
|
|
71
|
-
|
|
72
|
-
Community leaders will follow these Community Impact Guidelines in
|
|
73
|
-
determining the consequences for any action they deem in violation of
|
|
74
|
-
this Code of Conduct:
|
|
75
|
-
|
|
76
|
-
### 1. Correction
|
|
77
|
-
|
|
78
|
-
**Community Impact**: Use of inappropriate language or other behavior
|
|
79
|
-
deemed unprofessional or unwelcome in the community.
|
|
80
|
-
|
|
81
|
-
**Consequence**: A private, written warning from community leaders,
|
|
82
|
-
providing clarity around the nature of the violation and an explanation
|
|
83
|
-
of why the behavior was inappropriate. A public apology may be
|
|
84
|
-
requested.
|
|
85
|
-
|
|
86
|
-
### 2. Warning
|
|
87
|
-
|
|
88
|
-
**Community Impact**: A violation through a single incident or series of
|
|
89
|
-
actions.
|
|
90
|
-
|
|
91
|
-
**Consequence**: A warning with consequences for continued behavior. No
|
|
92
|
-
interaction with the people involved, including unsolicited interaction
|
|
93
|
-
with those enforcing the Code of Conduct, for a specified period of
|
|
94
|
-
time. This includes avoiding interactions in community spaces as well as
|
|
95
|
-
external channels like social media. Violating these terms may lead to a
|
|
96
|
-
temporary or permanent ban.
|
|
97
|
-
|
|
98
|
-
### 3. Temporary Ban
|
|
99
|
-
|
|
100
|
-
**Community Impact**: A serious violation of community standards,
|
|
101
|
-
including sustained inappropriate behavior.
|
|
102
|
-
|
|
103
|
-
**Consequence**: A temporary ban from any sort of interaction or public
|
|
104
|
-
communication with the community for a specified period of time. No
|
|
105
|
-
public or private interaction with the people involved, including
|
|
106
|
-
unsolicited interaction with those enforcing the Code of Conduct, is
|
|
107
|
-
allowed during this period. Violating these terms may lead to a
|
|
108
|
-
permanent ban.
|
|
109
|
-
|
|
110
|
-
### 4. Permanent Ban
|
|
111
|
-
|
|
112
|
-
**Community Impact**: Demonstrating a pattern of violation of community
|
|
113
|
-
standards, including sustained inappropriate behavior, harassment of an
|
|
114
|
-
individual, or aggression toward or disparagement of classes of
|
|
115
|
-
individuals.
|
|
116
|
-
|
|
117
|
-
**Consequence**: A permanent ban from any sort of public interaction
|
|
118
|
-
within the community.
|
|
119
|
-
|
|
120
|
-
## Attribution
|
|
121
|
-
|
|
122
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
123
|
-
version 2.1, available at
|
|
124
|
-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
125
|
-
|
|
126
|
-
Community Impact Guidelines were inspired by
|
|
127
|
-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
128
|
-
|
|
129
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
130
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
|
|
131
|
-
[https://www.contributor-covenant.org/translations][translations].
|
|
132
|
-
|
|
133
|
-
[homepage]: https://www.contributor-covenant.org
|
|
134
|
-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
135
|
-
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
136
|
-
[FAQ]: https://www.contributor-covenant.org/faq
|
|
137
|
-
[translations]: https://www.contributor-covenant.org/translations
|