particle_tracking_manager.config_the_manager¶
Defines TheManagerConfig class for the particle tracking manager.
Classes
|
Log verbosity. |
|
Lagrangian model software to use for simulation. |
|
Output file format. |
|
Configuration for the particle tracking manager. |
- class particle_tracking_manager.config_the_manager.LogLevelEnum(*values)[source]¶
Bases:
str,EnumLog verbosity.
Methods
capitalize(/)Return a capitalized version of the string.
casefold(/)Return a version of the string suitable for caseless comparisons.
center(width[, fillchar])Return a centered string of length width.
count(sub[, start[, end]], /)Return the number of non-overlapping occurrences of substring sub in string S[start:end].
encode(/[, encoding, errors])Encode the string using the codec registered for encoding.
endswith(suffix[, start[, end]], /)Return True if the string ends with the specified suffix, False otherwise.
expandtabs(/[, tabsize])Return a copy where all tab characters are expanded using spaces.
find(sub[, start[, end]], /)Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
format(*args, **kwargs)Return a formatted version of the string, using substitutions from args and kwargs.
format_map(mapping, /)Return a formatted version of the string, using substitutions from mapping.
index(sub[, start[, end]], /)Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
isalnum(/)Return True if the string is an alpha-numeric string, False otherwise.
isalpha(/)Return True if the string is an alphabetic string, False otherwise.
isascii(/)Return True if all characters in the string are ASCII, False otherwise.
isdecimal(/)Return True if the string is a decimal string, False otherwise.
isdigit(/)Return True if the string is a digit string, False otherwise.
isidentifier(/)Return True if the string is a valid Python identifier, False otherwise.
islower(/)Return True if the string is a lowercase string, False otherwise.
isnumeric(/)Return True if the string is a numeric string, False otherwise.
isprintable(/)Return True if the string is printable, False otherwise.
isspace(/)Return True if the string is a whitespace string, False otherwise.
istitle(/)Return True if the string is a title-cased string, False otherwise.
isupper(/)Return True if the string is an uppercase string, False otherwise.
join(iterable, /)Concatenate any number of strings.
ljust(width[, fillchar])Return a left-justified string of length width.
lower(/)Return a copy of the string converted to lowercase.
lstrip([chars])Return a copy of the string with leading whitespace removed.
maketrans(x[, y, z])Return a translation table usable for str.translate().
partition(sep, /)Partition the string into three parts using the given separator.
removeprefix(prefix, /)Return a str with the given prefix string removed if present.
removesuffix(suffix, /)Return a str with the given suffix string removed if present.
replace(old, new, /[, count])Return a copy with all occurrences of substring old replaced by new.
rfind(sub[, start[, end]], /)Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rindex(sub[, start[, end]], /)Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rjust(width[, fillchar])Return a right-justified string of length width.
rpartition(sep, /)Partition the string into three parts using the given separator.
rsplit(/[, sep, maxsplit])Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])Return a copy of the string with trailing whitespace removed.
split(/[, sep, maxsplit])Return a list of the substrings in the string, using sep as the separator string.
splitlines(/[, keepends])Return a list of the lines in the string, breaking at line boundaries.
startswith(prefix[, start[, end]], /)Return True if the string starts with the specified prefix, False otherwise.
strip([chars])Return a copy of the string with leading and trailing whitespace removed.
swapcase(/)Convert uppercase characters to lowercase and lowercase characters to uppercase.
title(/)Return a version of the string where each word is titlecased.
translate(table, /)Replace each character in the string using the given translation table.
upper(/)Return a copy of the string converted to uppercase.
zfill(width, /)Pad a numeric string with zeros on the left, to fill a field of the given width.
- CRITICAL = 'CRITICAL'¶
- DEBUG = 'DEBUG'¶
- ERROR = 'ERROR'¶
- INFO = 'INFO'¶
- WARNING = 'WARNING'¶
- capitalize(/)¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold(/)¶
Return a version of the string suitable for caseless comparisons.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub, [start, [end, ]]/)¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end].
Optional arguments start and end are interpreted as in slice notation.
- encode(/, encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- endswith(suffix, [start, [end, ]]/)¶
Return True if the string ends with the specified suffix, False otherwise.
- suffix
A string or a tuple of strings to try.
- start
Optional start position. Default: start of the string.
- end
Optional stop position. Default: end of the string.
- expandtabs(/, tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub, [start, [end, ]]/)¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
- format(*args, **kwargs)¶
Return a formatted version of the string, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping, /)¶
Return a formatted version of the string, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- index(sub, [start, [end, ]]/)¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
- isalnum(/)¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isalpha(/)¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isascii(/)¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- isdecimal(/)¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit(/)¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isidentifier(/)¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- islower(/)¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isnumeric(/)¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isprintable(/)¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- isspace(/)¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- istitle(/)¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isupper(/)¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower(/)¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- static maketrans(x, y=<unrepresentable>, z=<unrepresentable>, /)¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- replace(old, new, /, count=-1)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- rfind(sub, [start, [end, ]]/)¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
- rindex(sub, [start, [end, ]]/)¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- rsplit(/, sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- split(/, sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- splitlines(/, keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- startswith(prefix, [start, [end, ]]/)¶
Return True if the string starts with the specified prefix, False otherwise.
- prefix
A string or a tuple of strings to try.
- start
Optional start position. Default: start of the string.
- end
Optional stop position. Default: end of the string.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase(/)¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- title(/)¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper(/)¶
Return a copy of the string converted to uppercase.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- class particle_tracking_manager.config_the_manager.ModelEnum(*values)[source]¶
Bases:
str,EnumLagrangian model software to use for simulation.
Methods
capitalize(/)Return a capitalized version of the string.
casefold(/)Return a version of the string suitable for caseless comparisons.
center(width[, fillchar])Return a centered string of length width.
count(sub[, start[, end]], /)Return the number of non-overlapping occurrences of substring sub in string S[start:end].
encode(/[, encoding, errors])Encode the string using the codec registered for encoding.
endswith(suffix[, start[, end]], /)Return True if the string ends with the specified suffix, False otherwise.
expandtabs(/[, tabsize])Return a copy where all tab characters are expanded using spaces.
find(sub[, start[, end]], /)Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
format(*args, **kwargs)Return a formatted version of the string, using substitutions from args and kwargs.
format_map(mapping, /)Return a formatted version of the string, using substitutions from mapping.
index(sub[, start[, end]], /)Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
isalnum(/)Return True if the string is an alpha-numeric string, False otherwise.
isalpha(/)Return True if the string is an alphabetic string, False otherwise.
isascii(/)Return True if all characters in the string are ASCII, False otherwise.
isdecimal(/)Return True if the string is a decimal string, False otherwise.
isdigit(/)Return True if the string is a digit string, False otherwise.
isidentifier(/)Return True if the string is a valid Python identifier, False otherwise.
islower(/)Return True if the string is a lowercase string, False otherwise.
isnumeric(/)Return True if the string is a numeric string, False otherwise.
isprintable(/)Return True if the string is printable, False otherwise.
isspace(/)Return True if the string is a whitespace string, False otherwise.
istitle(/)Return True if the string is a title-cased string, False otherwise.
isupper(/)Return True if the string is an uppercase string, False otherwise.
join(iterable, /)Concatenate any number of strings.
ljust(width[, fillchar])Return a left-justified string of length width.
lower(/)Return a copy of the string converted to lowercase.
lstrip([chars])Return a copy of the string with leading whitespace removed.
maketrans(x[, y, z])Return a translation table usable for str.translate().
partition(sep, /)Partition the string into three parts using the given separator.
removeprefix(prefix, /)Return a str with the given prefix string removed if present.
removesuffix(suffix, /)Return a str with the given suffix string removed if present.
replace(old, new, /[, count])Return a copy with all occurrences of substring old replaced by new.
rfind(sub[, start[, end]], /)Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rindex(sub[, start[, end]], /)Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rjust(width[, fillchar])Return a right-justified string of length width.
rpartition(sep, /)Partition the string into three parts using the given separator.
rsplit(/[, sep, maxsplit])Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])Return a copy of the string with trailing whitespace removed.
split(/[, sep, maxsplit])Return a list of the substrings in the string, using sep as the separator string.
splitlines(/[, keepends])Return a list of the lines in the string, breaking at line boundaries.
startswith(prefix[, start[, end]], /)Return True if the string starts with the specified prefix, False otherwise.
strip([chars])Return a copy of the string with leading and trailing whitespace removed.
swapcase(/)Convert uppercase characters to lowercase and lowercase characters to uppercase.
title(/)Return a version of the string where each word is titlecased.
translate(table, /)Replace each character in the string using the given translation table.
upper(/)Return a copy of the string converted to uppercase.
zfill(width, /)Pad a numeric string with zeros on the left, to fill a field of the given width.
- capitalize(/)¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold(/)¶
Return a version of the string suitable for caseless comparisons.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub, [start, [end, ]]/)¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end].
Optional arguments start and end are interpreted as in slice notation.
- encode(/, encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- endswith(suffix, [start, [end, ]]/)¶
Return True if the string ends with the specified suffix, False otherwise.
- suffix
A string or a tuple of strings to try.
- start
Optional start position. Default: start of the string.
- end
Optional stop position. Default: end of the string.
- expandtabs(/, tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub, [start, [end, ]]/)¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
- format(*args, **kwargs)¶
Return a formatted version of the string, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping, /)¶
Return a formatted version of the string, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- index(sub, [start, [end, ]]/)¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
- isalnum(/)¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isalpha(/)¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isascii(/)¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- isdecimal(/)¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit(/)¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isidentifier(/)¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- islower(/)¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isnumeric(/)¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isprintable(/)¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- isspace(/)¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- istitle(/)¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isupper(/)¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower(/)¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- static maketrans(x, y=<unrepresentable>, z=<unrepresentable>, /)¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- opendrift = 'opendrift'¶
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- replace(old, new, /, count=-1)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- rfind(sub, [start, [end, ]]/)¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
- rindex(sub, [start, [end, ]]/)¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- rsplit(/, sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- split(/, sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- splitlines(/, keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- startswith(prefix, [start, [end, ]]/)¶
Return True if the string starts with the specified prefix, False otherwise.
- prefix
A string or a tuple of strings to try.
- start
Optional start position. Default: start of the string.
- end
Optional stop position. Default: end of the string.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase(/)¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- title(/)¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper(/)¶
Return a copy of the string converted to uppercase.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- class particle_tracking_manager.config_the_manager.OutputFormatEnum(*values)[source]¶
Bases:
str,EnumOutput file format.
Methods
capitalize(/)Return a capitalized version of the string.
casefold(/)Return a version of the string suitable for caseless comparisons.
center(width[, fillchar])Return a centered string of length width.
count(sub[, start[, end]], /)Return the number of non-overlapping occurrences of substring sub in string S[start:end].
encode(/[, encoding, errors])Encode the string using the codec registered for encoding.
endswith(suffix[, start[, end]], /)Return True if the string ends with the specified suffix, False otherwise.
expandtabs(/[, tabsize])Return a copy where all tab characters are expanded using spaces.
find(sub[, start[, end]], /)Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
format(*args, **kwargs)Return a formatted version of the string, using substitutions from args and kwargs.
format_map(mapping, /)Return a formatted version of the string, using substitutions from mapping.
index(sub[, start[, end]], /)Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
isalnum(/)Return True if the string is an alpha-numeric string, False otherwise.
isalpha(/)Return True if the string is an alphabetic string, False otherwise.
isascii(/)Return True if all characters in the string are ASCII, False otherwise.
isdecimal(/)Return True if the string is a decimal string, False otherwise.
isdigit(/)Return True if the string is a digit string, False otherwise.
isidentifier(/)Return True if the string is a valid Python identifier, False otherwise.
islower(/)Return True if the string is a lowercase string, False otherwise.
isnumeric(/)Return True if the string is a numeric string, False otherwise.
isprintable(/)Return True if the string is printable, False otherwise.
isspace(/)Return True if the string is a whitespace string, False otherwise.
istitle(/)Return True if the string is a title-cased string, False otherwise.
isupper(/)Return True if the string is an uppercase string, False otherwise.
join(iterable, /)Concatenate any number of strings.
ljust(width[, fillchar])Return a left-justified string of length width.
lower(/)Return a copy of the string converted to lowercase.
lstrip([chars])Return a copy of the string with leading whitespace removed.
maketrans(x[, y, z])Return a translation table usable for str.translate().
partition(sep, /)Partition the string into three parts using the given separator.
removeprefix(prefix, /)Return a str with the given prefix string removed if present.
removesuffix(suffix, /)Return a str with the given suffix string removed if present.
replace(old, new, /[, count])Return a copy with all occurrences of substring old replaced by new.
rfind(sub[, start[, end]], /)Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rindex(sub[, start[, end]], /)Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
rjust(width[, fillchar])Return a right-justified string of length width.
rpartition(sep, /)Partition the string into three parts using the given separator.
rsplit(/[, sep, maxsplit])Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])Return a copy of the string with trailing whitespace removed.
split(/[, sep, maxsplit])Return a list of the substrings in the string, using sep as the separator string.
splitlines(/[, keepends])Return a list of the lines in the string, breaking at line boundaries.
startswith(prefix[, start[, end]], /)Return True if the string starts with the specified prefix, False otherwise.
strip([chars])Return a copy of the string with leading and trailing whitespace removed.
swapcase(/)Convert uppercase characters to lowercase and lowercase characters to uppercase.
title(/)Return a version of the string where each word is titlecased.
translate(table, /)Replace each character in the string using the given translation table.
upper(/)Return a copy of the string converted to uppercase.
zfill(width, /)Pad a numeric string with zeros on the left, to fill a field of the given width.
- both = 'both'¶
- capitalize(/)¶
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
- casefold(/)¶
Return a version of the string suitable for caseless comparisons.
- center(width, fillchar=' ', /)¶
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
- count(sub, [start, [end, ]]/)¶
Return the number of non-overlapping occurrences of substring sub in string S[start:end].
Optional arguments start and end are interpreted as in slice notation.
- encode(/, encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
- encoding
The encoding in which to encode the string.
- errors
The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
- endswith(suffix, [start, [end, ]]/)¶
Return True if the string ends with the specified suffix, False otherwise.
- suffix
A string or a tuple of strings to try.
- start
Optional start position. Default: start of the string.
- end
Optional stop position. Default: end of the string.
- expandtabs(/, tabsize=8)¶
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
- find(sub, [start, [end, ]]/)¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
- format(*args, **kwargs)¶
Return a formatted version of the string, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).
- format_map(mapping, /)¶
Return a formatted version of the string, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).
- index(sub, [start, [end, ]]/)¶
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
- isalnum(/)¶
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
- isalpha(/)¶
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
- isascii(/)¶
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
- isdecimal(/)¶
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
- isdigit(/)¶
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
- isidentifier(/)¶
Return True if the string is a valid Python identifier, False otherwise.
Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.
- islower(/)¶
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
- isnumeric(/)¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
- isprintable(/)¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
- isspace(/)¶
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
- istitle(/)¶
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
- isupper(/)¶
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
- join(iterable, /)¶
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’
- ljust(width, fillchar=' ', /)¶
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
- lower(/)¶
Return a copy of the string converted to lowercase.
- lstrip(chars=None, /)¶
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
- static maketrans(x, y=<unrepresentable>, z=<unrepresentable>, /)¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
- netcdf = 'netcdf'¶
- parquet = 'parquet'¶
- partition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
- removeprefix(prefix, /)¶
Return a str with the given prefix string removed if present.
If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.
- removesuffix(suffix, /)¶
Return a str with the given suffix string removed if present.
If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.
- replace(old, new, /, count=-1)¶
Return a copy with all occurrences of substring old replaced by new.
- count
Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
- rfind(sub, [start, [end, ]]/)¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
- rindex(sub, [start, [end, ]]/)¶
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].
Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.
- rjust(width, fillchar=' ', /)¶
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
- rpartition(sep, /)¶
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
- rsplit(/, sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the end of the string and works to the front.
- rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- split(/, sep=None, maxsplit=-1)¶
Return a list of the substrings in the string, using sep as the separator string.
- sep
The separator used to split the string.
When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.
- maxsplit
Maximum number of splits. -1 (the default value) means no limit.
Splitting starts at the front of the string and works to the end.
Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.
- splitlines(/, keepends=False)¶
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
- startswith(prefix, [start, [end, ]]/)¶
Return True if the string starts with the specified prefix, False otherwise.
- prefix
A string or a tuple of strings to try.
- start
Optional start position. Default: start of the string.
- end
Optional stop position. Default: end of the string.
- strip(chars=None, /)¶
Return a copy of the string with leading and trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
- swapcase(/)¶
Convert uppercase characters to lowercase and lowercase characters to uppercase.
- title(/)¶
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
- translate(table, /)¶
Replace each character in the string using the given translation table.
- table
Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
- upper(/)¶
Return a copy of the string converted to uppercase.
- zfill(width, /)¶
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
- class particle_tracking_manager.config_the_manager.TheManagerConfig(*, model=ModelEnum.opendrift, lon=None, lat=None, geojson=None, start_time=datetime.datetime(2022, 1, 1, 0, 0), start_time_end=None, run_forward=True, time_step=300, time_step_output_integer=12, steps=None, duration=None, end_time=None, ocean_model='CIOFSOP', ocean_model_local=True, do3D=False, use_static_masks=False, output_file=None, output_format=OutputFormatEnum.netcdf, use_cache=True, log_level=LogLevelEnum.INFO, horizontal_diffusivity=None, stokes_drift=True, z=0, number=1)[source]¶
Bases:
BaseModelConfiguration for the particle tracking manager.
- Attributes:
model_extraGet extra fields set during validation.
model_fields_setReturns the set of fields that have been explicitly set on this model instance.
ocean_model_configSelect ocean model config based on ocean_model.
ocean_model_simulationSelect ocean model simulation based on ocean_model.
seed_flagDetermine seed_flag based on whether geojson is set.
time_step_outputCalculate time_step_output as time_step multiplied by time_step_output_integer.
timedirSet timedir to 1 for forward, -1 for backward.
Methods
Calculate horizontal diffusivity based on ocean model.
Calculate start_time, end_time, duration, and steps based on the other parameters.
Descrive how ocean_model_local is set.
Check if exactly two of start_time, end_time, duration, and steps are set.
Check if lon and lat are set when geojson is None, and vice versa.
copy(*[, include, exclude, update, deep])Returns a copy of the model.
If simulation is backward, make time_step negative.
model_construct([_fields_set])Creates a new instance of the Model class with validated data.
model_copy(*[, update, deep])!!! abstract "Usage Documentation"
model_dump(*[, mode, include, exclude, ...])!!! abstract "Usage Documentation"
model_dump_json(*[, indent, ensure_ascii, ...])!!! abstract "Usage Documentation"
model_json_schema([by_alias, ref_template, ...])Generates a JSON schema for a model class.
model_parametrized_name(params)Compute the class name for parametrizations of generic classes.
model_post_init(context, /)Override this method to perform additional initialization after __init__ and model_construct.
model_rebuild(*[, force, raise_errors, ...])Try to rebuild the pydantic-core schema for the model.
model_validate(obj, *[, strict, extra, ...])Validate a pydantic model instance.
model_validate_json(json_data, *[, strict, ...])!!! abstract "Usage Documentation"
model_validate_strings(obj, *[, strict, ...])Validate the given object with string data against the Pydantic model.
Remove timezone information from datetime fields.
Select ocean model simulation based on ocean_model.
Set up TXLA if used.
construct
dict
from_orm
json
parse_file
parse_obj
parse_raw
schema
schema_json
update_forward_refs
validate
- _abc_impl = <_abc._abc_data object>¶
- _calculate_keys(*args, **kwargs)¶
- _copy_and_set_values(*args, **kwargs)¶
- classmethod _get_value(*args, **kwargs)¶
- _iter(*args, **kwargs)¶
- _setattr_handler(name, value)¶
Get a handler for setting an attribute on the model instance.
- Returns:
A handler for setting an attribute on the model instance. Used for memoization of the handler. Memoizing the handlers leads to a dramatic performance improvement in __setattr__ Returns None when memoization is not safe, then the attribute is set directly.
- calculate_config_times()[source]¶
Calculate start_time, end_time, duration, and steps based on the other parameters.
- check_config_time_parameters()[source]¶
Check if exactly two of start_time, end_time, duration, and steps are set.
- check_lon_lat_geojson_consistency()[source]¶
Check if lon and lat are set when geojson is None, and vice versa.
- classmethod construct(_fields_set=None, **values)¶
- copy(*, include=None, exclude=None, update=None, deep=False)¶
Returns a copy of the model.
- !!! warning “Deprecated”
This method is now deprecated; use model_copy instead.
If you need include or exclude, use:
`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `- Parameters:
include – Optional set or mapping specifying which fields to include in the copied model.
exclude – Optional set or mapping specifying which fields to exclude in the copied model.
update – Optional dictionary of field-value pairs to override field values in the copied model.
deep – If True, the values of fields that are Pydantic models will be deep-copied.
- Returns:
A copy of the model with included, excluded and updated fields as specified.
- dict(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False)¶
- do3D¶
- duration¶
- end_time¶
- classmethod from_orm(obj)¶
- geojson¶
- horizontal_diffusivity¶
- json(*, include=None, exclude=None, by_alias=False, exclude_unset=False, exclude_defaults=False, exclude_none=False, encoder=PydanticUndefined, models_as_dict=PydanticUndefined, **dumps_kwargs)¶
- lat¶
- log_level¶
- lon¶
- match_time_step_sign_to_timedir_sign()[source]¶
If simulation is backward, make time_step negative.
Sign of input time_step is ignored.
- model¶
- model_computed_fields = {'ocean_model_config': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'particle_tracking_manager.ocean_model_registry.OceanModelConfig'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Select ocean model config based on ocean_model.', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'ocean_model_simulation': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'particle_tracking_manager.config_ocean_model.OceanModelSimulation'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Select ocean model simulation based on ocean_model.', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'seed_flag': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'str'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Determine seed_flag based on whether geojson is set.', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'time_step_output': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'float'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Calculate time_step_output as time_step multiplied by time_step_output_integer.', deprecated=None, examples=None, json_schema_extra=None, repr=True), 'timedir': ComputedFieldInfo(wrapped_property=<property object>, return_type=<class 'int'>, alias=None, alias_priority=None, title=None, field_title_generator=None, description='Set timedir to 1 for forward, -1 for backward.', deprecated=None, examples=None, json_schema_extra=None, repr=True)}¶
- model_config = {'extra': 'forbid', 'use_enum_values': True, 'validate_default': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod model_construct(_fields_set=None, **values)¶
Creates a new instance of the Model class with validated data.
Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.
- !!! note
model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.
- Parameters:
_fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.
values – Trusted or pre-validated data dictionary.
- Returns:
A new instance of the Model class with validated data.
- model_copy(*, update=None, deep=False)¶
- !!! abstract “Usage Documentation”
[model_copy](../concepts/models.md#model-copy)
Returns a copy of the model.
- !!! note
The underlying instance’s [__dict__][object.__dict__] attribute is copied. This might have unexpected side effects if you store anything in it, on top of the model fields (e.g. the value of [cached properties][functools.cached_property]).
- Parameters:
update – Values to change/add in the new model. Note: the data is not validated before creating the new model. You should trust this data.
deep – Set to True to make a deep copy of the model.
- Returns:
New model instance.
- model_dump(*, mode='python', include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False)¶
- !!! abstract “Usage Documentation”
[model_dump](../concepts/serialization.md#python-mode)
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- Parameters:
mode – The mode in which to_python should run. If mode is ‘json’, the output will only contain JSON serializable types. If mode is ‘python’, the output may contain non-JSON-serializable Python objects.
include – A set of fields to include in the output.
exclude – A set of fields to exclude from the output.
context – Additional context to pass to the serializer.
by_alias – Whether to use the field’s alias in the dictionary key if defined.
exclude_unset – Whether to exclude fields that have not been explicitly set.
exclude_defaults – Whether to exclude fields that are set to their default value.
exclude_none – Whether to exclude fields that have a value of None.
exclude_computed_fields – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.
round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].
warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].
fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.
serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.
- Returns:
A dictionary representation of the model.
- model_dump_json(*, indent=None, ensure_ascii=False, include=None, exclude=None, context=None, by_alias=None, exclude_unset=False, exclude_defaults=False, exclude_none=False, exclude_computed_fields=False, round_trip=False, warnings=True, fallback=None, serialize_as_any=False)¶
- !!! abstract “Usage Documentation”
[model_dump_json](../concepts/serialization.md#json-mode)
Generates a JSON representation of the model using Pydantic’s to_json method.
- Parameters:
indent – Indentation to use in the JSON output. If None is passed, the output will be compact.
ensure_ascii – If True, the output is guaranteed to have all incoming non-ASCII characters escaped. If False (the default), these characters will be output as-is.
include – Field(s) to include in the JSON output.
exclude – Field(s) to exclude from the JSON output.
context – Additional context to pass to the serializer.
by_alias – Whether to serialize using field aliases.
exclude_unset – Whether to exclude fields that have not been explicitly set.
exclude_defaults – Whether to exclude fields that are set to their default value.
exclude_none – Whether to exclude fields that have a value of None.
exclude_computed_fields – Whether to exclude computed fields. While this can be useful for round-tripping, it is usually recommended to use the dedicated round_trip parameter instead.
round_trip – If True, dumped values should be valid as input for non-idempotent types such as Json[T].
warnings – How to handle serialization errors. False/”none” ignores them, True/”warn” logs errors, “error” raises a [PydanticSerializationError][pydantic_core.PydanticSerializationError].
fallback – A function to call when an unknown value is encountered. If not provided, a [PydanticSerializationError][pydantic_core.PydanticSerializationError] error is raised.
serialize_as_any – Whether to serialize fields with duck-typing serialization behavior.
- Returns:
A JSON string representation of the model.
- property model_extra¶
Get extra fields set during validation.
- Returns:
A dictionary of extra fields, or None if config.extra is not set to “allow”.
- model_fields = {'do3D': FieldInfo(annotation=bool, required=False, default=False, description='Set to True to run drifters in 3D, by default False for most drift models.', json_schema_extra={'ptm_level': 1}), 'duration': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, description='Duration should be input as a string of ISO 8601. The length of the simulation. steps, end_time, or duration must be input by user.', json_schema_extra={'ptm_level': 1}), 'end_time': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None, description='The end of the simulation. steps, end_time, or duration must be input by user. start_time or end_time must be input. If a timezone is included, it will be used and the time will be converted to UTC which is the same timezone as the models.', json_schema_extra={'ptm_level': 1}), 'geojson': FieldInfo(annotation=Union[dict, NoneType], required=False, default=None, description='GeoJSON describing a polygon within which to seed drifters; must contain "geometry". If this is set, `lon` and `lat` should be None.', json_schema_extra={'ptm_level': 1}), 'horizontal_diffusivity': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, title='Horizontal Diffusivity', description='Add horizontal diffusivity (random walk). For known ocean models, the value is calculated as the approximate horizontal grid resolution for the selected ocean model times an estimate of the scale of sub-gridscale velocity of 0.1 m/s.', json_schema_extra={'units': 'm2/s', 'ptm_level': 2}, metadata=[Ge(ge=0), Le(le=100000)]), 'lat': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, description='Central latitude for seeding drifters. If this is set, `lon` should also be set, and `geojson` should be None.', json_schema_extra={'ptm_level': 1, 'units': 'degrees_north'}, metadata=[Ge(ge=-90), Le(le=90)]), 'log_level': FieldInfo(annotation=LogLevelEnum, required=False, default=<LogLevelEnum.INFO: 'INFO'>, description='Log verbosity', json_schema_extra={'ptm_level': 3}), 'lon': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, description='Central longitude for seeding drifters. If this is set, `lat` should also be set, and `geojson` should be None.', json_schema_extra={'ptm_level': 1, 'units': 'degrees_east'}, metadata=[Ge(ge=-180), Le(le=180)]), 'model': FieldInfo(annotation=ModelEnum, required=False, default=<ModelEnum.opendrift: 'opendrift'>, description='Lagrangian model software to use for simulation.', json_schema_extra={'ptm_level': 1}), 'number': FieldInfo(annotation=int, required=False, default=1, title='Number', description='The number of elements for the simulation.', json_schema_extra={'units': 1, 'ptm_level': 1}, metadata=[Ge(ge=1)]), 'ocean_model': FieldInfo(annotation=OceanModelEnum, required=False, default='CIOFSOP', description='Name of ocean model to use for driving drifter simulation.', json_schema_extra={'ptm_level': 1}), 'ocean_model_local': FieldInfo(annotation=bool, required=False, default=True, description='Set to True to use local version of known `ocean_model` instead of remote version.', json_schema_extra={'ptm_level': 3}), 'output_file': FieldInfo(annotation=Union[PathLike[str], NoneType], required=False, default=None, description='Name of file to write output to. If None, default name is used.', json_schema_extra={'ptm_level': 3}), 'output_format': FieldInfo(annotation=OutputFormatEnum, required=False, default=<OutputFormatEnum.netcdf: 'netcdf'>, description='Output file format. Options are "netcdf", "parquet", or "both".', json_schema_extra={'ptm_level': 2}), 'run_forward': FieldInfo(annotation=bool, required=False, default=True, description='Run forward in time.', json_schema_extra={'ptm_level': 2}), 'start_time': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=datetime.datetime(2022, 1, 1, 0, 0), description='Start time for drifter simulation. start_time or end_time must be input. If a timezone is included, it will be used and the time will be converted to UTC which is the same timezone as the models.', json_schema_extra={'ptm_level': 1}), 'start_time_end': FieldInfo(annotation=Union[datetime, NoneType], required=False, default=None, description='If used, this creates a range of start times for drifters, starting with `start_time` and ending with `start_time_end`. Drifters will be initialized linearly between the two start times. If a timezone is included, it will be used and the time will be converted to UTC which is the same timezone as the models.', json_schema_extra={'ptm_level': 2}), 'steps': FieldInfo(annotation=Union[int, NoneType], required=False, default=None, description='Maximum number of steps. End of simulation will be start_time + steps * time_step.', json_schema_extra={'ptm_level': 1}, metadata=[Ge(ge=1), Le(le=10000)]), 'stokes_drift': FieldInfo(annotation=bool, required=False, default=True, title='Stokes Drift', description='Advection elements with Stokes drift (wave orbital motion).', json_schema_extra={'ptm_level': 2}), 'time_step': FieldInfo(annotation=float, required=False, default=300, description='Interval between particles updates, in seconds.', json_schema_extra={'ptm_level': 3, 'units': 'seconds'}, metadata=[Ge(ge=0.01), Le(le=1440)]), 'time_step_output_integer': FieldInfo(annotation=int, required=False, default=12, description='Time step at which element properties are stored and eventually written to file, calculated as time_step*time_step_output_integer. This must be an integer multiple of this.', json_schema_extra={'ptm_level': 3, 'units': ''}, metadata=[Ge(ge=1), Le(le=300)]), 'use_cache': FieldInfo(annotation=bool, required=False, default=True, description='Set to True to use cache for storing interpolators.', json_schema_extra={'ptm_level': 3}), 'use_static_masks': FieldInfo(annotation=bool, required=False, default=False, description="If True, use static ocean model land masks. This saves some computation time but since the available ocean models run in wet/dry mode, it is inconsistent with the ROMS output files in some places since the drifters may be allowed (due to the static mask) to enter a cell they wouldn't otherwise. However, it doesn't make much of a difference for simulations that aren't in the tidal flats. Use the time-varying wet/dry masks (set to False) if drifters are expected to run in the tidal flats. This costs some more computational time but is fully consistent with the ROMS output files.", json_schema_extra={'ptm_level': 3}), 'z': FieldInfo(annotation=Union[float, NoneType], required=False, default=0, title='Z', description='Depth below sea level where elements are released. This depth is neglected if seafloor seeding is set selected.', json_schema_extra={'units': 'm', 'ptm_level': 1}, metadata=[Ge(ge=-10000), Le(le=0)])}¶
- property model_fields_set¶
Returns the set of fields that have been explicitly set on this model instance.
- Returns:
- A set of strings representing the fields that have been set,
i.e. that were not filled from defaults.
- classmethod model_json_schema(by_alias=True, ref_template='#/$defs/{model}', schema_generator=<class 'pydantic.json_schema.GenerateJsonSchema'>, mode='validation', *, union_format='any_of')¶
Generates a JSON schema for a model class.
- Parameters:
by_alias – Whether to use attribute aliases or not.
ref_template – The reference template.
union_format –
The format to use when combining schemas from unions together. Can be one of:
’any_of’: Use the [anyOf](https://json-schema.org/understanding-json-schema/reference/combining#anyOf)
keyword to combine schemas (the default). - ‘primitive_type_array’: Use the [type](https://json-schema.org/understanding-json-schema/reference/type) keyword as an array of strings, containing each type of the combination. If any of the schemas is not a primitive type (string, boolean, null, integer or number) or contains constraints/metadata, falls back to any_of.
schema_generator – To override the logic used to generate the JSON schema, as a subclass of GenerateJsonSchema with your desired modifications
mode – The mode in which to generate the schema.
- Returns:
The JSON schema for the given model class.
- classmethod model_parametrized_name(params)¶
Compute the class name for parametrizations of generic classes.
This method can be overridden to achieve a custom naming scheme for generic BaseModels.
- Parameters:
params – Tuple of types of the class. Given a generic class Model with 2 type variables and a concrete model Model[str, int], the value (str, int) would be passed to params.
- Returns:
String representing the new class where params are passed to cls as type variables.
- Raises:
TypeError – Raised when trying to generate concrete names for non-generic models.
- model_post_init(context, /)¶
Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.
- classmethod model_rebuild(*, force=False, raise_errors=True, _parent_namespace_depth=2, _types_namespace=None)¶
Try to rebuild the pydantic-core schema for the model.
This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails.
- Parameters:
force – Whether to force the rebuilding of the model schema, defaults to False.
raise_errors – Whether to raise errors, defaults to True.
_parent_namespace_depth – The depth level of the parent namespace, defaults to 2.
_types_namespace – The types namespace, defaults to None.
- Returns:
Returns None if the schema is already “complete” and rebuilding was not required. If rebuilding _was_ required, returns True if rebuilding was successful, otherwise False.
- classmethod model_validate(obj, *, strict=None, extra=None, from_attributes=None, context=None, by_alias=None, by_name=None)¶
Validate a pydantic model instance.
- Parameters:
obj – The object to validate.
strict – Whether to enforce types strictly.
extra – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.
from_attributes – Whether to extract data from object attributes.
context – Additional context to pass to the validator.
by_alias – Whether to use the field’s alias when validating against the provided input data.
by_name – Whether to use the field’s name when validating against the provided input data.
- Raises:
ValidationError – If the object could not be validated.
- Returns:
The validated model instance.
- classmethod model_validate_json(json_data, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)¶
- !!! abstract “Usage Documentation”
[JSON Parsing](../concepts/json.md#json-parsing)
Validate the given JSON data against the Pydantic model.
- Parameters:
json_data – The JSON data to validate.
strict – Whether to enforce types strictly.
extra – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.
context – Extra variables to pass to the validator.
by_alias – Whether to use the field’s alias when validating against the provided input data.
by_name – Whether to use the field’s name when validating against the provided input data.
- Returns:
The validated Pydantic model.
- Raises:
ValidationError – If json_data is not a JSON string or the object could not be validated.
- classmethod model_validate_strings(obj, *, strict=None, extra=None, context=None, by_alias=None, by_name=None)¶
Validate the given object with string data against the Pydantic model.
- Parameters:
obj – The object containing string data to validate.
strict – Whether to enforce types strictly.
extra – Whether to ignore, allow, or forbid extra data during model validation. See the [extra configuration value][pydantic.ConfigDict.extra] for details.
context – Extra variables to pass to the validator.
by_alias – Whether to use the field’s alias when validating against the provided input data.
by_name – Whether to use the field’s name when validating against the provided input data.
- Returns:
The validated Pydantic model.
- number¶
- ocean_model¶
- property ocean_model_config¶
Select ocean model config based on ocean_model.
- ocean_model_local¶
- property ocean_model_simulation¶
Select ocean model simulation based on ocean_model.
- output_file¶
- output_format¶
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)¶
- classmethod parse_obj(obj)¶
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)¶
- run_forward¶
- classmethod schema(by_alias=True, ref_template='#/$defs/{model}')¶
- classmethod schema_json(*, by_alias=True, ref_template='#/$defs/{model}', **dumps_kwargs)¶
- property seed_flag¶
Determine seed_flag based on whether geojson is set.
- select_ocean_model_simulation_on_init()[source]¶
Select ocean model simulation based on ocean_model.
- start_time¶
- start_time_end¶
- steps¶
- stokes_drift¶
- time_step¶
- property time_step_output¶
Calculate time_step_output as time_step multiplied by time_step_output_integer.
- time_step_output_integer¶
- property timedir¶
Set timedir to 1 for forward, -1 for backward.
- classmethod update_forward_refs(**localns)¶
- use_cache¶
- use_static_masks¶
- classmethod validate(value)¶
- z¶