BallAerospace / python-ballcosmos

Python Support for Ball Aerospace COSMOS v4
Other
18 stars 4 forks source link

Improve examples by adding comments #14

Closed keck-in-space closed 3 years ago

keck-in-space commented 3 years ago

It is difficult to understand how to use the updated version of this library by looking at the examples. It would be nice to have additional documentation so it is clearer what is required to interface with this library.

cosmos_v4_example.py

import sys
import threading

# This line does not appear to be standard (I don't have that path). Should it be removed from the example?
sys.path.append("C:/git/python-ballcosmos")

import os

# A comment here would be helpful to explain when this is necessary
try:
    os.environ["COSMOS_USERPATH"]
except KeyError:
    os.environ["COSMOS_USERPATH"] = "C:/COSMOS/Demo"

# This seems like it affects some of the internals of how this library works, but I see no documentation about it.
try:
    os.environ["COSMOS_VERSION"]
except KeyError:
    os.environ["COSMOS_VERSION"] = "4"

try:
    os.environ["COSMOS_DEBUG"]
except KeyError:
    os.environ["COSMOS_DEBUG"] = ""

# This appears to be a debug print
FILE_PATH = os.path.dirname(os.path.abspath(__file__))
print(FILE_PATH)

from ballcosmos.script import *

# This appears to be a debug print
print(ballcosmos.top_level.USERPATH)

# What is this line doing? What is "TACO"? Is this required by the user of this library?
update_scope("TACO")
ghost commented 3 years ago

Hi @keck-in-space I just pushed an update the ballcosmos master branch to 1.1.0 and removed a lot of the changes I did for 1.0.0. I appreciate the feedback. I have started a docs directory that should allow better documentation for ballcosmos going forward.