<jupyter_start><jupyter_text>Splitting the Sunspec Because of technical limitations with the shadow, we'll separate out the writable and read only points. The max size of a given named shadow is only 30k (and that's only if you ask AWS for an extension).  Also the update chunk size is only 1k, and updating shadows is more expensive than sending a normal MQTT message.By keeping the writable points in the shadow we can still make use of the powerful state tracking and "desired" shadow features of the IOT Shadow, but only where they are needed.<jupyter_code>#export
class TelemetrySunspecEncoder(GeneralSunspecEncoder):
    include_readonly_points=True
    include_writable_points=False
    
class ShadowSunspecEncoder(GeneralSunspecEncoder):
    include_readonly_points=False
    include_writable_points=True
dev = assemble([{'mid': 802}])
telem = encode(dev, using=TelemetrySunspecEncoder, as_obj=True)
TESTCASE.assertEqual(len(telem['0']['fixed'].keys()), 38)

shadow = encode(dev, using=ShadowSunspecEncoder, as_obj=True)
TESTCASE.assertEqual(len(shadow['0']['fixed'].keys()), 6)

notebook2script(_nbpath)<jupyter_output>Converted factory.ipynb.
{'fraction_non_alphanumeric': 0.08159722222222222, 'fraction_numerical': 0.010416666666666666, 'mean_word_length': 6.5359477124183005, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '326248', 'license': 'Apache-2.0', 'n_tokens_mistral': 337, 'n_tokens_neox': 320, 'n_words': 116, 'path': 'nbs/factory.ipynb', 'repo_name': 'except-pass/shadowsunspec', 'size': '1152'}