Skip to content

Commit

Permalink
lestarch: sp
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed May 3, 2022
1 parent 659dd26 commit cbf049f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ autoapi
autocoded
autocode
Autocoders
autocoders
autocoding
autodoc
autoescape
Expand Down Expand Up @@ -118,6 +119,7 @@ isdir
isfile
isinstance
isnumeric
issubclass
iterdir
itertools
itle
Expand Down Expand Up @@ -200,6 +202,7 @@ SCLK
scm
sdd
Serializables
serializables
setuptools
shutil
someotherpath
Expand Down
4 changes: 2 additions & 2 deletions src/fprime/common/models/serialize/serializable_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class SerializableType(DictionaryType):

@classmethod
def construct_type(cls, name, member_list=None):
"""Consturct a new serializable sub-type
"""Construct a new serializable sub-type
Constructs a new serializable subtype from the supplied member list and name. Member list may optionaly excluede
Constructs a new serializable subtype from the supplied member list and name. Member list may optionally exclude
description keys, which will be filled with None.
Args:
Expand Down
6 changes: 3 additions & 3 deletions src/fprime/common/models/serialize/string_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class StringType(type_base.DictionaryType):
"""
String type representation for F prime. This is a type that stores a half-word first for representing the length of
this given string. Each sub stiring class defines the sub-type property max length that represents the maximum
this given string. Each sub string class defines the sub-type property max length that represents the maximum
length of any string value stored to it.
All string types follow this implementation, but have some specific type-based properties: MAX_LENGTH.
Expand All @@ -29,8 +29,8 @@ class StringType(type_base.DictionaryType):
@classmethod
def construct_type(cls, name, max_length=None):
"""Constructs a new string type with given name and maximum length"""
tmp = type_base.DictionaryType.construct_type(cls, name, MAX_LENGTH=max_length)
return tmp
temporary = type_base.DictionaryType.construct_type(cls, name, MAX_LENGTH=max_length)
return temporary

def validate(self, val):
"""Validates that this is a string"""
Expand Down
8 changes: 4 additions & 4 deletions src/fprime/common/models/serialize/type_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ class DictionaryType(ValueType, abc.ABC):
"""Type whose specification is defined in the dictionary
Certain types in fprime (strings, serializables, enums) are defined in the dictionary. Where all projects have
access to primitave types (U8, F32, etc) and the definitions of theses types is global, other types complete
access to primative types (U8, F32, etc) and the definitions of theses types is global, other types complete
specification comes from the dictionary itself. String set max-lengths per project, serializable fields are defined,
and enumeration values are enumerated. This class is designed to take a baes framework (StringType, etc) and build
a dynamic subclass for the given dictionary defined type.
and enumeration values are enumerated. This class is designed to take base complex types (StringType, etc) and build
dynamic subclasses for the given dictionary defined type.
"""

_CONSTRUCTS = {}
Expand All @@ -110,7 +110,7 @@ def construct_type(this_cls, cls, name, **class_properties):
Args:
name: name of the new sub type
**class_properties: properties to define on the subtype (e.g. max lenght for strings)
**class_properties: properties to define on the subtype (e.g. max length for strings)
"""
assert (
cls != DictionaryType
Expand Down

0 comments on commit cbf049f

Please sign in to comment.