fameio 3.3.0__py3-none-any.whl → 3.5.0__py3-none-any.whl

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.
Files changed (63) hide show
  1. fameio/__init__.py +2 -1
  2. fameio/cli/__init__.py +2 -0
  3. fameio/cli/convert_results.py +8 -0
  4. fameio/cli/make_config.py +2 -0
  5. fameio/cli/options.py +4 -0
  6. fameio/cli/parser.py +17 -1
  7. fameio/cli/reformat.py +2 -0
  8. fameio/input/__init__.py +2 -1
  9. fameio/input/loader/__init__.py +1 -0
  10. fameio/input/loader/controller.py +12 -0
  11. fameio/input/loader/loader.py +2 -0
  12. fameio/input/metadata.py +2 -0
  13. fameio/input/resolver.py +2 -0
  14. fameio/input/scenario/__init__.py +2 -0
  15. fameio/input/scenario/agent.py +2 -0
  16. fameio/input/scenario/attribute.py +2 -0
  17. fameio/input/scenario/contract.py +57 -10
  18. fameio/input/scenario/exception.py +2 -0
  19. fameio/input/scenario/fameiofactory.py +2 -0
  20. fameio/input/scenario/generalproperties.py +2 -0
  21. fameio/input/scenario/scenario.py +2 -0
  22. fameio/input/scenario/stringset.py +2 -0
  23. fameio/input/schema/__init__.py +1 -0
  24. fameio/input/schema/agenttype.py +2 -0
  25. fameio/input/schema/attribute.py +2 -0
  26. fameio/input/schema/java_packages.py +2 -0
  27. fameio/input/schema/schema.py +8 -3
  28. fameio/input/validator.py +2 -0
  29. fameio/input/writer.py +16 -0
  30. fameio/logs.py +2 -1
  31. fameio/output/__init__.py +1 -0
  32. fameio/output/agent_type.py +14 -0
  33. fameio/output/conversion.py +2 -0
  34. fameio/output/csv_writer.py +4 -2
  35. fameio/output/data_transformer.py +2 -0
  36. fameio/output/execution_dao.py +5 -0
  37. fameio/output/input_dao.py +5 -3
  38. fameio/output/metadata/__init__.py +10 -0
  39. fameio/output/metadata/compiler.py +75 -0
  40. fameio/output/metadata/json_writer.py +37 -0
  41. fameio/output/metadata/locator.py +242 -0
  42. fameio/output/metadata/oeo_template.py +93 -0
  43. fameio/output/metadata/template_reader.py +65 -0
  44. fameio/output/output_dao.py +2 -0
  45. fameio/output/reader.py +1 -0
  46. fameio/output/yaml_writer.py +3 -1
  47. fameio/scripts/__init__.py +4 -0
  48. fameio/scripts/convert_results.py +35 -2
  49. fameio/scripts/exception.py +1 -0
  50. fameio/series.py +14 -6
  51. fameio/time.py +42 -0
  52. fameio/tools.py +1 -0
  53. fameio-3.5.0.dist-info/LICENSES/CC-BY-ND-4.0.txt +392 -0
  54. fameio-3.5.0.dist-info/METADATA +99 -0
  55. fameio-3.5.0.dist-info/RECORD +67 -0
  56. fameio-3.3.0.dist-info/METADATA +0 -976
  57. fameio-3.3.0.dist-info/RECORD +0 -60
  58. {fameio-3.3.0.dist-info → fameio-3.5.0.dist-info}/LICENSE.txt +0 -0
  59. {fameio-3.3.0.dist-info → fameio-3.5.0.dist-info}/LICENSES/Apache-2.0.txt +0 -0
  60. {fameio-3.3.0.dist-info → fameio-3.5.0.dist-info}/LICENSES/CC-BY-4.0.txt +0 -0
  61. {fameio-3.3.0.dist-info → fameio-3.5.0.dist-info}/LICENSES/CC0-1.0.txt +0 -0
  62. {fameio-3.3.0.dist-info → fameio-3.5.0.dist-info}/WHEEL +0 -0
  63. {fameio-3.3.0.dist-info → fameio-3.5.0.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env python
2
+ """Main scripts callable from command line."""
2
3
  import sys
3
4
 
4
5
  from fameio.scripts.convert_results import DEFAULT_CONFIG as DEFAULT_CONVERT_CONFIG
@@ -13,6 +14,7 @@ from fameio.cli.reformat import handle_args as handle_reformat_args
13
14
 
14
15
  # noinspection PyPep8Naming
15
16
  def makeFameRunConfig():
17
+ """Compiles FAME simulation input files in protobuf format."""
16
18
  cli_config = handle_make_config_args(sys.argv[1:])
17
19
  try:
18
20
  make_config(cli_config)
@@ -22,6 +24,7 @@ def makeFameRunConfig():
22
24
 
23
25
  # noinspection PyPep8Naming
24
26
  def convertFameResults():
27
+ """Converts a protobuf file to human-readable outputs."""
25
28
  cli_config = handle_convert_results_args(sys.argv[1:], DEFAULT_CONVERT_CONFIG)
26
29
  try:
27
30
  convert_results(cli_config)
@@ -31,6 +34,7 @@ def convertFameResults():
31
34
 
32
35
  # noinspection PyPep8Naming
33
36
  def reformatTimeSeries():
37
+ """Reformats a timeseries file to speed up its future usage in scenarios."""
34
38
  cli_config = handle_reformat_args(sys.argv[1:])
35
39
  try:
36
40
  reformat(cli_config)
@@ -19,6 +19,10 @@ from fameio.output.csv_writer import CsvWriter
19
19
  from fameio.output.data_transformer import DataTransformer, INDEX
20
20
  from fameio.output.execution_dao import ExecutionDao
21
21
  from fameio.output.input_dao import InputDao
22
+ from fameio.output.metadata.compiler import MetadataCompiler
23
+ from fameio.output.metadata.json_writer import data_to_json_file
24
+ from fameio.output.metadata.oeo_template import OEO_TEMPLATE
25
+ from fameio.output.metadata.template_reader import read_template_file
22
26
  from fameio.output.output_dao import OutputDAO
23
27
  from fameio.output.reader import Reader
24
28
  from fameio.output.yaml_writer import data_to_yaml_file
@@ -73,7 +77,7 @@ def _extract_and_convert_data(config: dict[Options, Any], file_stream: BinaryIO,
73
77
  execution_dao = ExecutionDao()
74
78
  while data_storages := reader.read():
75
79
  execution_dao.store_execution_metadata(data_storages)
76
- if config[Options.INPUT_RECOVERY]:
80
+ if config[Options.INPUT_RECOVERY] or config[Options.METADATA]:
77
81
  input_dao.store_inputs(data_storages)
78
82
  output = OutputDAO(data_storages, agent_type_log)
79
83
  for agent_name in output.get_sorted_agents_to_extract():
@@ -95,6 +99,8 @@ def _extract_and_convert_data(config: dict[Options, Any], file_stream: BinaryIO,
95
99
  log().warning(_WARN_OUTPUT_SUPPRESSED.format(agent_type_log.get_agents_with_output()))
96
100
  else:
97
101
  log().warning(_WARN_OUTPUT_MISSING)
102
+ elif config[Options.METADATA]:
103
+ write_metadata(config, input_dao, execution_dao, agent_type_log)
98
104
  log().info("Data conversion completed.")
99
105
 
100
106
 
@@ -143,8 +149,35 @@ def _memory_saving_apply_conversions(config: dict[Options, Any], output_writer:
143
149
  output_writer.write_to_files(agent_name, parsed_data)
144
150
 
145
151
 
152
+ def write_metadata(
153
+ config: dict[Options, Any], input_dao: InputDao, execution_dao: ExecutionDao, agent_type_log: AgentTypeLog
154
+ ):
155
+ """Reads metadata templates, fills in available metadata, and writes output to a JSON file.
156
+
157
+ Args:
158
+ config: to determined metadata template, and output path
159
+ input_dao: contains input data
160
+ execution_dao: contains execution metadata
161
+ agent_type_log: contains log about which agent output was created
162
+
163
+ Raises:
164
+ OutputError: in case templates could not be read or filled-in, or JSON writing failed, logged with level "ERROR"
165
+ """
166
+ compiler = MetadataCompiler(
167
+ input_data=input_dao.get_input_data(),
168
+ execution_data=execution_dao.get_metadata_dict(),
169
+ agent_columns=agent_type_log.get_agent_columns(),
170
+ )
171
+
172
+ template_file = config[Options.METADATA_TEMPLATE]
173
+ template = OEO_TEMPLATE if template_file is None else read_template_file(template_file)
174
+ metadata = compiler.locate_and_replace(template)
175
+ base_path = config[Options.OUTPUT] if config[Options.OUTPUT] is not None else Path(".")
176
+ data_to_json_file(metadata, base_path)
177
+
178
+
146
179
  def run(config: dict[Options, Any] | None = None) -> None:
147
- """Reads configured file in protobuf format and extracts its content to .CSV and .YAML file(s).
180
+ """Reads configured file in protobuf format and extracts its content to CSV and YAML file(s).
148
181
 
149
182
  Args:
150
183
  config: script configuration options
@@ -1,6 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+ """Defines exceptions on the script level."""
4
5
 
5
6
 
6
7
  class ScriptError(Exception):
fameio/series.py CHANGED
@@ -1,6 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+ """Reading and writing of timeseries data, ensuring their proper formatting and uniqueness."""
4
5
  from __future__ import annotations
5
6
 
6
7
  import math
@@ -25,17 +26,19 @@ FILE_LENGTH_WARN_LIMIT = int(50e3)
25
26
 
26
27
 
27
28
  class TimeSeriesError(InputError, OutputError):
28
- """Indicates that an error occurred during management of time series"""
29
+ """Indicates that an error occurred during management of time series."""
29
30
 
30
31
 
31
32
  class Entry(Enum):
33
+ """Parameter keys to describe a timeseries entry."""
34
+
32
35
  ID = auto()
33
36
  NAME = auto()
34
37
  DATA = auto()
35
38
 
36
39
 
37
40
  class TimeSeriesManager:
38
- """Manages matching of files to time series ids and their protobuf representation."""
41
+ """Manages matching of timeseries data from files and values to unique ids and vice versa."""
39
42
 
40
43
  _TIMESERIES_RECONSTRUCTION_PATH = "./timeseries/"
41
44
  _CONSTANT_IDENTIFIER = "Constant value: {}"
@@ -59,6 +62,11 @@ class TimeSeriesManager:
59
62
  )
60
63
 
61
64
  def __init__(self, path_resolver: PathResolver = PathResolver()) -> None:
65
+ """Instantiates a new TimeSeriesManager.
66
+
67
+ Args:
68
+ path_resolver: to use when searching for time series in files
69
+ """
62
70
  self._path_resolver = path_resolver
63
71
  self._id_count = -1
64
72
  self._series_by_id: dict[str | int | float, dict[Entry, Any]] = {}
@@ -279,7 +287,7 @@ class TimeSeriesManager:
279
287
  self._series_by_id[one_series.series_id] = reconstructed
280
288
 
281
289
  def _get_cleaned_file_name(self, timeseries_name: str) -> str:
282
- """Ensure given file name has CSV file ending."""
290
+ """Ensures given file name has CSV file ending."""
283
291
  if Path(timeseries_name).suffix.lower() == CSV_FILE_SUFFIX:
284
292
  filename = Path(timeseries_name).name
285
293
  else:
@@ -287,12 +295,12 @@ class TimeSeriesManager:
287
295
  return str(Path(self._TIMESERIES_RECONSTRUCTION_PATH, filename))
288
296
 
289
297
  def get_reconstructed_series_by_id(self, series_id: int) -> str:
290
- """Return name or path for given `series_id` if series these are identified by their number.
298
+ """Returns name or path for given `series_id` if series are identified by their number.
291
299
 
292
- Use this only if series were added via `reconstruct_time_series`
300
+ Use this only if series were added via `reconstruct_time_series`.
293
301
 
294
302
  Args:
295
- series_id: number of series
303
+ series_id: numeric identifier of the series
296
304
 
297
305
  Returns:
298
306
  name or path of time series
fameio/time.py CHANGED
@@ -1,6 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+ """Conversion of times to and from FAME format."""
4
5
  from __future__ import annotations
5
6
 
6
7
  import datetime as dt
@@ -17,6 +18,7 @@ START_IN_REAL_TIME = "2000-01-01_00:00:00"
17
18
  DATE_FORMAT = "%Y-%m-%d_%H:%M:%S"
18
19
  DATE_REGEX = re.compile("[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}:[0-9]{2}:[0-9]{2}")
19
20
  FAME_FIRST_DATETIME = dt.datetime.strptime(START_IN_REAL_TIME, DATE_FORMAT)
21
+ TIME_SPAN_REGEX = re.compile(r"^[0-9]+\s*[A-z]+$")
20
22
 
21
23
 
22
24
  class ConversionError(InputError, OutputError):
@@ -71,6 +73,8 @@ class FameTime:
71
73
  _INVALID_TOO_LARGE = "Cannot convert time stamp string '{}' - last day of leap year is Dec 30th!"
72
74
  _NO_TIMESTAMP = "Time value expected, but '{}' is neither a time stamp string nor an integer."
73
75
  _INVALID_DATE_FORMAT = "Received invalid date format '{}'."
76
+ _INVALID_SPAN_FORMAT = "Time span must be provided in the format '<positive integer> <TimeUnit>' but was: '{}'"
77
+ _INVALID_TIME_UNIT = f"Time span unit '{{}}' unknown, must be one of: {[u.name for u in TimeUnit]}"
74
78
 
75
79
  @staticmethod
76
80
  def convert_datetime_to_fame_time_step(datetime_string: str) -> int:
@@ -160,6 +164,32 @@ class FameTime:
160
164
  return steps * value
161
165
  raise log_error(ConversionError(FameTime._TIME_UNIT_UNKNOWN.format(unit)))
162
166
 
167
+ @staticmethod
168
+ def convert_text_to_time_span(string: str) -> int:
169
+ """Converts given string in form of "<positive integer> <TimeUnit>" to a time span in FAME time steps.
170
+
171
+ Args:
172
+ string: to convert to a time span from
173
+
174
+ Returns:
175
+ FAME time steps equivalent of `value x unit`
176
+
177
+ Raises:
178
+ ConversionError: if an unknown time unit or an unsupported format is used, logged with level "ERROR"
179
+ """
180
+ string = string.strip()
181
+ if TIME_SPAN_REGEX.fullmatch(string) is None:
182
+ raise log_error(ConversionError(FameTime._INVALID_SPAN_FORMAT.format(string)))
183
+ multiple, unit_name = string.split()
184
+ unit_name = unit_name.upper()
185
+ if not unit_name.endswith("S"):
186
+ unit_name += "S"
187
+ try:
188
+ unit = TimeUnit[unit_name]
189
+ except KeyError as e:
190
+ raise log_error(ConversionError(FameTime._INVALID_TIME_UNIT.format(unit_name))) from e
191
+ return FameTime.convert_time_span_to_fame_time_steps(int(multiple), unit)
192
+
163
193
  @staticmethod
164
194
  def is_datetime(string: Any) -> bool:
165
195
  """Returns `True` if given `string` matches Datetime string format and can be converted to FAME time step."""
@@ -208,3 +238,15 @@ class FameTime:
208
238
  return int(value)
209
239
  except ValueError as e:
210
240
  raise log_error(ConversionError(FameTime._NO_TIMESTAMP.format(value))) from e
241
+
242
+ @staticmethod
243
+ def get_first_fame_time_step_of_year(year: int) -> int:
244
+ """Returns FAME time in integer format of first time step of given year.
245
+
246
+ Args:
247
+ year: to get the first time step for
248
+
249
+ Returns:
250
+ first time step in the requested year in integer format
251
+ """
252
+ return (year - FAME_FIRST_DATETIME.year) * Constants.STEPS_PER_YEAR
fameio/tools.py CHANGED
@@ -1,6 +1,7 @@
1
1
  # SPDX-FileCopyrightText: 2025 German Aerospace Center <fame@dlr.de>
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
+ """Collection of static methods employed in various contexts."""
4
5
  from __future__ import annotations
5
6
 
6
7
  from pathlib import Path
@@ -0,0 +1,392 @@
1
+ Attribution-NoDerivatives 4.0 International
2
+
3
+ =======================================================================
4
+
5
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
6
+ does not provide legal services or legal advice. Distribution of
7
+ Creative Commons public licenses does not create a lawyer-client or
8
+ other relationship. Creative Commons makes its licenses and related
9
+ information available on an "as-is" basis. Creative Commons gives no
10
+ warranties regarding its licenses, any material licensed under their
11
+ terms and conditions, or any related information. Creative Commons
12
+ disclaims all liability for damages resulting from their use to the
13
+ fullest extent possible.
14
+
15
+ Using Creative Commons Public Licenses
16
+
17
+ Creative Commons public licenses provide a standard set of terms and
18
+ conditions that creators and other rights holders may use to share
19
+ original works of authorship and other material subject to copyright
20
+ and certain other rights specified in the public license below. The
21
+ following considerations are for informational purposes only, are not
22
+ exhaustive, and do not form part of our licenses.
23
+
24
+ Considerations for licensors: Our public licenses are
25
+ intended for use by those authorized to give the public
26
+ permission to use material in ways otherwise restricted by
27
+ copyright and certain other rights. Our licenses are
28
+ irrevocable. Licensors should read and understand the terms
29
+ and conditions of the license they choose before applying it.
30
+ Licensors should also secure all rights necessary before
31
+ applying our licenses so that the public can reuse the
32
+ material as expected. Licensors should clearly mark any
33
+ material not subject to the license. This includes other CC-
34
+ licensed material, or material used under an exception or
35
+ limitation to copyright. More considerations for licensors:
36
+ wiki.creativecommons.org/Considerations_for_licensors
37
+
38
+ Considerations for the public: By using one of our public
39
+ licenses, a licensor grants the public permission to use the
40
+ licensed material under specified terms and conditions. If
41
+ the licensor's permission is not necessary for any reason--for
42
+ example, because of any applicable exception or limitation to
43
+ copyright--then that use is not regulated by the license. Our
44
+ licenses grant only permissions under copyright and certain
45
+ other rights that a licensor has authority to grant. Use of
46
+ the licensed material may still be restricted for other
47
+ reasons, including because others have copyright or other
48
+ rights in the material. A licensor may make special requests,
49
+ such as asking that all changes be marked or described.
50
+ Although not required by our licenses, you are encouraged to
51
+ respect those requests where reasonable. More considerations
52
+ for the public:
53
+ wiki.creativecommons.org/Considerations_for_licensees
54
+
55
+
56
+ =======================================================================
57
+
58
+ Creative Commons Attribution-NoDerivatives 4.0 International Public
59
+ License
60
+
61
+ By exercising the Licensed Rights (defined below), You accept and agree
62
+ to be bound by the terms and conditions of this Creative Commons
63
+ Attribution-NoDerivatives 4.0 International Public License ("Public
64
+ License"). To the extent this Public License may be interpreted as a
65
+ contract, You are granted the Licensed Rights in consideration of Your
66
+ acceptance of these terms and conditions, and the Licensor grants You
67
+ such rights in consideration of benefits the Licensor receives from
68
+ making the Licensed Material available under these terms and
69
+ conditions.
70
+
71
+
72
+ Section 1 -- Definitions.
73
+
74
+ a. Adapted Material means material subject to Copyright and Similar
75
+ Rights that is derived from or based upon the Licensed Material
76
+ and in which the Licensed Material is translated, altered,
77
+ arranged, transformed, or otherwise modified in a manner requiring
78
+ permission under the Copyright and Similar Rights held by the
79
+ Licensor. For purposes of this Public License, where the Licensed
80
+ Material is a musical work, performance, or sound recording,
81
+ Adapted Material is always produced where the Licensed Material is
82
+ synched in timed relation with a moving image.
83
+
84
+ b. Copyright and Similar Rights means copyright and/or similar rights
85
+ closely related to copyright including, without limitation,
86
+ performance, broadcast, sound recording, and Sui Generis Database
87
+ Rights, without regard to how the rights are labeled or
88
+ categorized. For purposes of this Public License, the rights
89
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
90
+ Rights.
91
+
92
+ c. Effective Technological Measures means those measures that, in the
93
+ absence of proper authority, may not be circumvented under laws
94
+ fulfilling obligations under Article 11 of the WIPO Copyright
95
+ Treaty adopted on December 20, 1996, and/or similar international
96
+ agreements.
97
+
98
+ d. Exceptions and Limitations means fair use, fair dealing, and/or
99
+ any other exception or limitation to Copyright and Similar Rights
100
+ that applies to Your use of the Licensed Material.
101
+
102
+ e. Licensed Material means the artistic or literary work, database,
103
+ or other material to which the Licensor applied this Public
104
+ License.
105
+
106
+ f. Licensed Rights means the rights granted to You subject to the
107
+ terms and conditions of this Public License, which are limited to
108
+ all Copyright and Similar Rights that apply to Your use of the
109
+ Licensed Material and that the Licensor has authority to license.
110
+
111
+ g. Licensor means the individual(s) or entity(ies) granting rights
112
+ under this Public License.
113
+
114
+ h. Share means to provide material to the public by any means or
115
+ process that requires permission under the Licensed Rights, such
116
+ as reproduction, public display, public performance, distribution,
117
+ dissemination, communication, or importation, and to make material
118
+ available to the public including in ways that members of the
119
+ public may access the material from a place and at a time
120
+ individually chosen by them.
121
+
122
+ i. Sui Generis Database Rights means rights other than copyright
123
+ resulting from Directive 96/9/EC of the European Parliament and of
124
+ the Council of 11 March 1996 on the legal protection of databases,
125
+ as amended and/or succeeded, as well as other essentially
126
+ equivalent rights anywhere in the world.
127
+
128
+ j. You means the individual or entity exercising the Licensed Rights
129
+ under this Public License. Your has a corresponding meaning.
130
+
131
+
132
+ Section 2 -- Scope.
133
+
134
+ a. License grant.
135
+
136
+ 1. Subject to the terms and conditions of this Public License,
137
+ the Licensor hereby grants You a worldwide, royalty-free,
138
+ non-sublicensable, non-exclusive, irrevocable license to
139
+ exercise the Licensed Rights in the Licensed Material to:
140
+
141
+ a. reproduce and Share the Licensed Material, in whole or
142
+ in part; and
143
+
144
+ b. produce and reproduce, but not Share, Adapted Material.
145
+
146
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
147
+ Exceptions and Limitations apply to Your use, this Public
148
+ License does not apply, and You do not need to comply with
149
+ its terms and conditions.
150
+
151
+ 3. Term. The term of this Public License is specified in Section
152
+ 6(a).
153
+
154
+ 4. Media and formats; technical modifications allowed. The
155
+ Licensor authorizes You to exercise the Licensed Rights in
156
+ all media and formats whether now known or hereafter created,
157
+ and to make technical modifications necessary to do so. The
158
+ Licensor waives and/or agrees not to assert any right or
159
+ authority to forbid You from making technical modifications
160
+ necessary to exercise the Licensed Rights, including
161
+ technical modifications necessary to circumvent Effective
162
+ Technological Measures. For purposes of this Public License,
163
+ simply making modifications authorized by this Section 2(a)
164
+ (4) never produces Adapted Material.
165
+
166
+ 5. Downstream recipients.
167
+
168
+ a. Offer from the Licensor -- Licensed Material. Every
169
+ recipient of the Licensed Material automatically
170
+ receives an offer from the Licensor to exercise the
171
+ Licensed Rights under the terms and conditions of this
172
+ Public License.
173
+
174
+ b. No downstream restrictions. You may not offer or impose
175
+ any additional or different terms or conditions on, or
176
+ apply any Effective Technological Measures to, the
177
+ Licensed Material if doing so restricts exercise of the
178
+ Licensed Rights by any recipient of the Licensed
179
+ Material.
180
+
181
+ 6. No endorsement. Nothing in this Public License constitutes or
182
+ may be construed as permission to assert or imply that You
183
+ are, or that Your use of the Licensed Material is, connected
184
+ with, or sponsored, endorsed, or granted official status by,
185
+ the Licensor or others designated to receive attribution as
186
+ provided in Section 3(a)(1)(A)(i).
187
+
188
+ b. Other rights.
189
+
190
+ 1. Moral rights, such as the right of integrity, are not
191
+ licensed under this Public License, nor are publicity,
192
+ privacy, and/or other similar personality rights; however, to
193
+ the extent possible, the Licensor waives and/or agrees not to
194
+ assert any such rights held by the Licensor to the limited
195
+ extent necessary to allow You to exercise the Licensed
196
+ Rights, but not otherwise.
197
+
198
+ 2. Patent and trademark rights are not licensed under this
199
+ Public License.
200
+
201
+ 3. To the extent possible, the Licensor waives any right to
202
+ collect royalties from You for the exercise of the Licensed
203
+ Rights, whether directly or through a collecting society
204
+ under any voluntary or waivable statutory or compulsory
205
+ licensing scheme. In all other cases the Licensor expressly
206
+ reserves any right to collect such royalties.
207
+
208
+
209
+ Section 3 -- License Conditions.
210
+
211
+ Your exercise of the Licensed Rights is expressly made subject to the
212
+ following conditions.
213
+
214
+ a. Attribution.
215
+
216
+ 1. If You Share the Licensed Material, You must:
217
+
218
+ a. retain the following if it is supplied by the Licensor
219
+ with the Licensed Material:
220
+
221
+ i. identification of the creator(s) of the Licensed
222
+ Material and any others designated to receive
223
+ attribution, in any reasonable manner requested by
224
+ the Licensor (including by pseudonym if
225
+ designated);
226
+
227
+ ii. a copyright notice;
228
+
229
+ iii. a notice that refers to this Public License;
230
+
231
+ iv. a notice that refers to the disclaimer of
232
+ warranties;
233
+
234
+ v. a URI or hyperlink to the Licensed Material to the
235
+ extent reasonably practicable;
236
+
237
+ b. indicate if You modified the Licensed Material and
238
+ retain an indication of any previous modifications; and
239
+
240
+ c. indicate the Licensed Material is licensed under this
241
+ Public License, and include the text of, or the URI or
242
+ hyperlink to, this Public License.
243
+
244
+ For the avoidance of doubt, You do not have permission under
245
+ this Public License to Share Adapted Material.
246
+
247
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
248
+ reasonable manner based on the medium, means, and context in
249
+ which You Share the Licensed Material. For example, it may be
250
+ reasonable to satisfy the conditions by providing a URI or
251
+ hyperlink to a resource that includes the required
252
+ information.
253
+
254
+ 3. If requested by the Licensor, You must remove any of the
255
+ information required by Section 3(a)(1)(A) to the extent
256
+ reasonably practicable.
257
+
258
+
259
+ Section 4 -- Sui Generis Database Rights.
260
+
261
+ Where the Licensed Rights include Sui Generis Database Rights that
262
+ apply to Your use of the Licensed Material:
263
+
264
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
265
+ to extract, reuse, reproduce, and Share all or a substantial
266
+ portion of the contents of the database, provided You do not Share
267
+ Adapted Material;
268
+
269
+ b. if You include all or a substantial portion of the database
270
+ contents in a database in which You have Sui Generis Database
271
+ Rights, then the database in which You have Sui Generis Database
272
+ Rights (but not its individual contents) is Adapted Material; and
273
+
274
+ c. You must comply with the conditions in Section 3(a) if You Share
275
+ all or a substantial portion of the contents of the database.
276
+
277
+ For the avoidance of doubt, this Section 4 supplements and does not
278
+ replace Your obligations under this Public License where the Licensed
279
+ Rights include other Copyright and Similar Rights.
280
+
281
+
282
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
283
+
284
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
285
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
286
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
287
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
288
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
289
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
290
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
291
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
292
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
293
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
294
+
295
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
296
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
297
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
298
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
299
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
300
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
301
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
302
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
303
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
304
+
305
+ c. The disclaimer of warranties and limitation of liability provided
306
+ above shall be interpreted in a manner that, to the extent
307
+ possible, most closely approximates an absolute disclaimer and
308
+ waiver of all liability.
309
+
310
+
311
+ Section 6 -- Term and Termination.
312
+
313
+ a. This Public License applies for the term of the Copyright and
314
+ Similar Rights licensed here. However, if You fail to comply with
315
+ this Public License, then Your rights under this Public License
316
+ terminate automatically.
317
+
318
+ b. Where Your right to use the Licensed Material has terminated under
319
+ Section 6(a), it reinstates:
320
+
321
+ 1. automatically as of the date the violation is cured, provided
322
+ it is cured within 30 days of Your discovery of the
323
+ violation; or
324
+
325
+ 2. upon express reinstatement by the Licensor.
326
+
327
+ For the avoidance of doubt, this Section 6(b) does not affect any
328
+ right the Licensor may have to seek remedies for Your violations
329
+ of this Public License.
330
+
331
+ c. For the avoidance of doubt, the Licensor may also offer the
332
+ Licensed Material under separate terms or conditions or stop
333
+ distributing the Licensed Material at any time; however, doing so
334
+ will not terminate this Public License.
335
+
336
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
337
+ License.
338
+
339
+
340
+ Section 7 -- Other Terms and Conditions.
341
+
342
+ a. The Licensor shall not be bound by any additional or different
343
+ terms or conditions communicated by You unless expressly agreed.
344
+
345
+ b. Any arrangements, understandings, or agreements regarding the
346
+ Licensed Material not stated herein are separate from and
347
+ independent of the terms and conditions of this Public License.
348
+
349
+
350
+ Section 8 -- Interpretation.
351
+
352
+ a. For the avoidance of doubt, this Public License does not, and
353
+ shall not be interpreted to, reduce, limit, restrict, or impose
354
+ conditions on any use of the Licensed Material that could lawfully
355
+ be made without permission under this Public License.
356
+
357
+ b. To the extent possible, if any provision of this Public License is
358
+ deemed unenforceable, it shall be automatically reformed to the
359
+ minimum extent necessary to make it enforceable. If the provision
360
+ cannot be reformed, it shall be severed from this Public License
361
+ without affecting the enforceability of the remaining terms and
362
+ conditions.
363
+
364
+ c. No term or condition of this Public License will be waived and no
365
+ failure to comply consented to unless expressly agreed to by the
366
+ Licensor.
367
+
368
+ d. Nothing in this Public License constitutes or may be interpreted
369
+ as a limitation upon, or waiver of, any privileges and immunities
370
+ that apply to the Licensor or You, including from the legal
371
+ processes of any jurisdiction or authority.
372
+
373
+ =======================================================================
374
+
375
+ Creative Commons is not a party to its public
376
+ licenses. Notwithstanding, Creative Commons may elect to apply one of
377
+ its public licenses to material it publishes and in those instances
378
+ will be considered the “Licensor.” The text of the Creative Commons
379
+ public licenses is dedicated to the public domain under the CC0 Public
380
+ Domain Dedication. Except for the limited purpose of indicating that
381
+ material is shared under a Creative Commons public license or as
382
+ otherwise permitted by the Creative Commons policies published at
383
+ creativecommons.org/policies, Creative Commons does not authorize the
384
+ use of the trademark "Creative Commons" or any other trademark or logo
385
+ of Creative Commons without its prior written consent including,
386
+ without limitation, in connection with any unauthorized modifications
387
+ to any of its public licenses or any other arrangements,
388
+ understandings, or agreements concerning use of licensed material. For
389
+ the avoidance of doubt, this paragraph does not form part of the
390
+ public licenses.
391
+
392
+ Creative Commons may be contacted at creativecommons.org.