<jupyter_start><jupyter_text>This notebook tests the functionality of position.py<jupyter_code>from smartscope.source import position as pos<jupyter_output><empty_output><jupyter_text>Test StagePosition()<jupyter_code>stage = pos.StagePosition(x=0)
stage2 = pos.StagePosition(x=3, y=4, z=0)
stage3 = pos.StagePosition(x=0, y=0, z=0)
stage4 = pos.StagePosition(x=9, y=9, z=0, theta=90)
stage5 = pos.StagePosition(x=0, y=0, z=0)

stagelist = [stage, stage2, stage3, stage4, stage5]
stagelist2 = [stage2, stage]

# test __str__()
print (stage)
print (stage2)
print (stage3)
# Test __eq__() function 
assert (stage==stage2) is False, '== error'
assert (stage==stage3) is False, '== error'
assert (stage3==stage5) is True, '== error'
# Test dist()
assert stage3.dist(stage5) == 0, 'dist error'
assert stage2.dist(stage3) == 5, 'dist error'<jupyter_output><empty_output><jupyter_text>Test PositionList()<jupyter_code># Test __init__(), append()
posit = pos.PositionList(stage)
posit.append(stage2)

posit2 = pos.PositionList(stage)
posit2.append(stage2)

posit3 = pos.PositionList(positions=stagelist)
# Test __len__()
assert len(posit3) == 5
assert len(posit) == 2
assert len(posit2) == 2
# Test __add__()
p = posit + posit3
assert len(p) == 7
# Test __iter__()
for position in p:
    print (position)
# Test __getitem__(), __setitem__(), __delitem__()
assert p[1].x == 3
assert p[4].z == 0

p[1].x = 4
assert p[1].x == 4

del p[1]
for position in p:
    print (position)
# Test visualize()
del p[0]
del p[0]
del p[2]
p.visualize()
# Test save()
for i in p:
    print (i)
p.save('test', './')
# Test load()
loaded = pos.load('test', './')
for i in loaded:
    print (i)
# Test current()
import MMCorePy
mmc = MMCorePy.CMMCore()
mmc.loadSystemConfiguration("../../config/MMConfig_YellenLab_ubuntu.cfg")
mmc.setFocusDevice("FocusDrive")

curr = pos.current(mmc)
print (curr)
# Test set_pos()
pos.set_pos(mmc, x=curr[0], y=curr[1]+10)
print (pos.current(mmc))<jupyter_output>(-15163.4, 6150.6, 357215014156.4894)
{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.04590818363273453, 'mean_word_length': 5.728187919463087, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '49654', 'license': 'MIT', 'n_tokens_mistral': 831, 'n_tokens_neox': 790, 'n_words': 189, 'path': 'SmartScope/smartscope/notebook/testing/position_test.ipynb', 'repo_name': 'calebsanfo/IncubatorImaging', 'size': '2004'}