diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
new file mode 100644
index 0000000..1b85a0f
--- /dev/null
+++ b/.github/workflows/python-package.yml
@@ -0,0 +1,40 @@
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: Python package
+
+on:
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v3
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ python -m pip install flake8 pytest
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ - name: Test with pytest
+ run: |
+ pytest
diff --git a/.idea/GMAT-Python-simple.iml b/.idea/GMAT-Python-simple.iml
index aad402c..ec63674 100644
--- a/.idea/GMAT-Python-simple.iml
+++ b/.idea/GMAT-Python-simple.iml
@@ -4,7 +4,4 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml
new file mode 100644
index 0000000..966c379
--- /dev/null
+++ b/.idea/dictionaries/project.xml
@@ -0,0 +1,7 @@
+
+
+
+ gmatpy
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 8bc1bfb..ab4f6ba 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -1,23 +1,36 @@
+
+
+
+
+
+
+
+
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
index 105ce2d..dd4c951 100644
--- a/.idea/inspectionProfiles/profiles_settings.xml
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -1,5 +1,6 @@
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 7ddfc9e..883037f 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -6,7 +6,4 @@
-
-
-
\ No newline at end of file
diff --git a/examples/example.py b/examples/example.py
index e23cd53..65e8621 100644
--- a/examples/example.py
+++ b/examples/example.py
@@ -3,8 +3,8 @@
from __future__ import annotations
import os
-from load_gmat import gmat
import gmat_py_simple as gpy
+from gmat_py_simple import gmat as gmat
# Set log and script options
log_path = os.path.normpath(f'{os.getcwd()}/GMAT-Log-example.txt')
diff --git a/examples/minimum_propagate_using_defaults.py b/examples/minimum_propagate_using_defaults.py
index 1cc1866..78ff1bd 100644
--- a/examples/minimum_propagate_using_defaults.py
+++ b/examples/minimum_propagate_using_defaults.py
@@ -8,7 +8,8 @@
# Set log and script options
log_path = os.path.normpath(f'{os.getcwd()}/GMAT-Log.txt')
gmat.UseLogFile(log_path)
-gmat.GmatGlobal.Instance().SetCommandEchoMode(True) # enables "CurrentCommand: [command generating string]" print out in log
+gmat.GmatGlobal.Instance().SetCommandEchoMode(
+ True) # enables "CurrentCommand: [command generating string]" print out in log
gmat.EchoLogFile(False) # set to True to have the log also print to the console as it's written
# Shortcuts for later
diff --git a/examples/tutorials/Tut01_SimulatingAnOrbit.py b/examples/tutorials/Tut01_SimulatingAnOrbit.py
index badb050..c8ac8e8 100644
--- a/examples/tutorials/Tut01_SimulatingAnOrbit.py
+++ b/examples/tutorials/Tut01_SimulatingAnOrbit.py
@@ -2,10 +2,12 @@
# Written by William Easdown Babb
from __future__ import annotations
-from load_gmat import gmat
-import gmat_py_simple as gpy
+
import os
+import gmat_py_simple as gpy
+from gmat_py_simple import gmat
+
log_path = os.path.normpath(f'{os.getcwd()}/GMAT-Log.txt')
gmat.UseLogFile(log_path)
echo_log = False
diff --git a/examples/tutorials/Tut02_SimpleOrbitTransfer.py b/examples/tutorials/Tut02_SimpleOrbitTransfer.py
index 952f6b0..67748ab 100644
--- a/examples/tutorials/Tut02_SimpleOrbitTransfer.py
+++ b/examples/tutorials/Tut02_SimpleOrbitTransfer.py
@@ -25,17 +25,17 @@
# Targeting sequence to adjust parameters of the two burns (TOI and GOI) to achieve desired final orbit
tg1 = gpy.Target('Hohmann Transfer', dc1, exit_mode='SaveAndContinue', command_sequence=[
- # Vary the velocity of the TOI burn to achieve an apoapsis with RMAG = 42165 km
- gpy.Vary('Vary TOI', dc1, f'{toi.name}.Element1'),
- gpy.Maneuver('Perform TOI', toi, sat),
- gpy.Propagate('Prop To Apoapsis', sat, prop, f'{sat.name}.Earth.Apoapsis'),
- gpy.Achieve('Achieve RMAG = 42165', dc1, f'{sat.name}.Earth.RMAG', 42164.169, 0.1),
-
- # Vary the velocity of the GOI burn to achieve an eccentricity of 0.005
- gpy.Vary('Vary GOI', dc1, f'{goi.name}.Element1', max_step=0.2),
- gpy.Maneuver('Perform GOI', goi, sat),
- gpy.Achieve('Achieve ECC = 0.005', dc1, f'{sat.name}.Earth.ECC', 0.005, 0.0001)
- ])
+ # Vary the velocity of the TOI burn to achieve an apoapsis with RMAG = 42165 km
+ gpy.Vary('Vary TOI', dc1, f'{toi.name}.Element1'),
+ gpy.Maneuver('Perform TOI', toi, sat),
+ gpy.Propagate('Prop To Apoapsis', sat, prop, f'{sat.name}.Earth.Apoapsis'),
+ gpy.Achieve('Achieve RMAG = 42165', dc1, f'{sat.name}.Earth.RMAG', 42164.169, 0.1),
+
+ # Vary the velocity of the GOI burn to achieve an eccentricity of 0.005
+ gpy.Vary('Vary GOI', dc1, f'{goi.name}.Element1', max_step=0.2),
+ gpy.Maneuver('Perform GOI', goi, sat),
+ gpy.Achieve('Achieve ECC = 0.005', dc1, f'{sat.name}.Earth.ECC', 0.005, 0.0001)
+])
# Mission Command Sequence
mcs = [
diff --git a/gmat_py_simple/__init__.py b/gmat_py_simple/__init__.py
index e5f1806..90ba41e 100644
--- a/gmat_py_simple/__init__.py
+++ b/gmat_py_simple/__init__.py
@@ -1,3 +1,10 @@
+from .import_lib import gmat_path
+
+from .load_gmat import *
+
+# GMAT's built-in library that interfaces to GMAT's source code.
+gmat: types.ModuleType = load_gmat.gmat
+
from .api_funcs import *
from .basics import *
from .burn import *
diff --git a/gmat_py_simple/api_funcs.py b/gmat_py_simple/api_funcs.py
index 5758f04..2ed1d05 100644
--- a/gmat_py_simple/api_funcs.py
+++ b/gmat_py_simple/api_funcs.py
@@ -1,11 +1,12 @@
from __future__ import annotations
-from load_gmat import gmat
+from gmat_py_simple import gmat
import gmat_py_simple as gpy
import os.path
+## TODO remove commented code
# def GetObject(name: str) -> gmat.GmatBase:
# try:
# obj: gmat.GmatBase = gmat.GetObject(name)
diff --git a/gmat_py_simple/basics.py b/gmat_py_simple/basics.py
index 7a4b839..2c80552 100644
--- a/gmat_py_simple/basics.py
+++ b/gmat_py_simple/basics.py
@@ -1,7 +1,8 @@
from __future__ import annotations
import gmat_py_simple as gpy
-from load_gmat import gmat
+# from gmat_py_simple import gmat
+from gmat_py_simple.load_gmat import gmat
from datetime import datetime
diff --git a/gmat_py_simple/burn.py b/gmat_py_simple/burn.py
index bbbff24..a95f64d 100644
--- a/gmat_py_simple/burn.py
+++ b/gmat_py_simple/burn.py
@@ -3,7 +3,7 @@
import gmat_py_simple as gpy
from gmat_py_simple.basics import GmatObject
-from load_gmat import gmat
+from gmat_py_simple import gmat
class Burn(GmatObject):
diff --git a/gmat_py_simple/commands.py b/gmat_py_simple/commands.py
index b799e26..7ee65de 100644
--- a/gmat_py_simple/commands.py
+++ b/gmat_py_simple/commands.py
@@ -1,7 +1,7 @@
from __future__ import annotations
from math import pi
-from load_gmat import gmat
+from gmat_py_simple import gmat
import gmat_py_simple as gpy
from gmat_py_simple.utils import *
@@ -211,54 +211,54 @@ def __init__(self, name: str, solver: gpy.DifferentialCorrector | gmat.Different
# # param_type is the final element of the self.variable string, e.g. Periapsis for Sat.Earth.Periapsis
# param_eles = self.variable.split('.')
# param_type = param_eles[-1]
- # new_param = gpy.Parameter(param_type, self.variable)
- # for ele in param_eles:
- # body = 'Earth'
- # cs = 'EarthMJ2000Eq'
- # if ele in gpy.CelestialBodies(): # a CelestialBody is given, so need to set it as a ref object
- # # TODO: test this
- # body = ele
- #
- # if ele in gpy.CoordSystems():
- # cs = ele
- #
- # pass
- # new_param.SetRefObjectName(gmat.SPACE_POINT, body)
- # new_param.SetRefObjectName(gmat.COORDINATE_SYSTEM, cs)
- # new_param.Help()
- # print(new_param.gmat_base.GetRefObjectTypeArray())
- # new_param.SetRefObjectName(gmat.CELESTIAL_BODY, ele)
-
- # if ele in gpy.CoordSystems(): # a CoordinateSystem is given, so need to set it as a ref object
- # # TODO remove (debugging only)
- # test_bddot = gmat.Construct('BdotT', 'TestBdotT')
- # test_bddot.SetRefObjectName(gmat.SPACECRAFT, 'MAVEN')
- # # test_bddot.SetReference(gmat.GetObject('MAVEN'))
- # # print(gpy.Moderator().gmat_obj.GetListOfFactoryItems(gmat.PARAMETER))
- # # test_bddot.RenameRefObject(gmat.COORDINATE_SYSTEM, 'EarthMJ2000Eq', ele)
- # test_bddot.SetRefObjectName(gmat.COORDINATE_SYSTEM, ele)
- # cs = gmat.GetObject(ele)
- # test_bddot.SetRefObject(cs, gmat.COORDINATE_SYSTEM, cs.GetName())
- #
- # # test_bddot.SetRefObjectName(gmat.SPACECRAFT, 'MAVEN')
- # test_bddot.SetRefObject(gmat.GetObject('MAVEN'), gmat.SPACECRAFT, 'MAVEN')
- #
- # test_bddot.SetSolarSystem(gmat.GetSolarSystem())
- # # gmat.Initialize()
- # mod = gpy.Moderator().gmat_obj
- # mod.SetParameterRefObject(test_bddot, 'BdotT', cs.GetName(), '', '', 1)
- # test_bddot.Help()
- # test_bddot.Initialize()
- #
- # new_param.SetRefObjectName(gmat.COORDINATE_SYSTEM, ele)
- # # new_param.SetStringParameter(new_param.GetParameterID('CoordinateSystem'), ele)
- # # new_param.SetRefObject(gmat.GetObject(ele), gmat.COORDINATE_SYSTEM)
- # new_param.Help()
- # pass
- #
- # for body in gpy.CelestialBodies():
- # if body in self.variable:
- # new_param.SetRefObject(gmat.Planet(body), gmat.COORDINATE_SYSTEM)
+ # new_param = gpy.Parameter(param_type, self.variable)
+ # for ele in param_eles:
+ # body = 'Earth'
+ # cs = 'EarthMJ2000Eq'
+ # if ele in gpy.CelestialBodies(): # a CelestialBody is given, so need to set it as a ref object
+ # # TODO: test this
+ # body = ele
+ #
+ # if ele in gpy.CoordSystems():
+ # cs = ele
+ #
+ # pass
+ # new_param.SetRefObjectName(gmat.SPACE_POINT, body)
+ # new_param.SetRefObjectName(gmat.COORDINATE_SYSTEM, cs)
+ # new_param.Help()
+ # print(new_param.gmat_base.GetRefObjectTypeArray())
+ # new_param.SetRefObjectName(gmat.CELESTIAL_BODY, ele)
+
+ # if ele in gpy.CoordSystems(): # a CoordinateSystem is given, so need to set it as a ref object
+ # # TODO remove (debugging only)
+ # test_bddot = gmat.Construct('BdotT', 'TestBdotT')
+ # test_bddot.SetRefObjectName(gmat.SPACECRAFT, 'MAVEN')
+ # # test_bddot.SetReference(gmat.GetObject('MAVEN'))
+ # # print(gpy.Moderator().gmat_obj.GetListOfFactoryItems(gmat.PARAMETER))
+ # # test_bddot.RenameRefObject(gmat.COORDINATE_SYSTEM, 'EarthMJ2000Eq', ele)
+ # test_bddot.SetRefObjectName(gmat.COORDINATE_SYSTEM, ele)
+ # cs = gmat.GetObject(ele)
+ # test_bddot.SetRefObject(cs, gmat.COORDINATE_SYSTEM, cs.GetName())
+ #
+ # # test_bddot.SetRefObjectName(gmat.SPACECRAFT, 'MAVEN')
+ # test_bddot.SetRefObject(gmat.GetObject('MAVEN'), gmat.SPACECRAFT, 'MAVEN')
+ #
+ # test_bddot.SetSolarSystem(gmat.GetSolarSystem())
+ # # gmat.Initialize()
+ # mod = gpy.Moderator().gmat_obj
+ # mod.SetParameterRefObject(test_bddot, 'BdotT', cs.GetName(), '', '', 1)
+ # test_bddot.Help()
+ # test_bddot.Initialize()
+ #
+ # new_param.SetRefObjectName(gmat.COORDINATE_SYSTEM, ele)
+ # # new_param.SetStringParameter(new_param.GetParameterID('CoordinateSystem'), ele)
+ # # new_param.SetRefObject(gmat.GetObject(ele), gmat.COORDINATE_SYSTEM)
+ # new_param.Help()
+ # pass
+ #
+ # for body in gpy.CelestialBodies():
+ # if body in self.variable:
+ # new_param.SetRefObject(gmat.Planet(body), gmat.COORDINATE_SYSTEM)
self.value = value
self.SetStringParameter('GoalValue', str(self.value))
@@ -280,7 +280,8 @@ def SetRefObject(self, obj, type_int: int, obj_name: str = '') -> bool:
class BeginFiniteBurn(GmatCommand):
- def __init__(self, burn: gpy.FiniteBurn | gmat.FiniteBurn, spacecraft: gpy.Spacecraft | gmat.Spacecraft, name: str = ''):
+ def __init__(self, burn: gpy.FiniteBurn | gmat.FiniteBurn, spacecraft: gpy.Spacecraft | gmat.Spacecraft,
+ name: str = ''):
super().__init__('BeginFiniteBurn', name)
# Assign the user-provided FiniteBurn to this command
@@ -293,7 +294,8 @@ def __init__(self, burn: gpy.FiniteBurn | gmat.FiniteBurn, spacecraft: gpy.Space
# self.spacecraft.Help()
# print(type(self.spacecraft))
# self.burn.SetSpacecraftToManeuver(gpy.extract_gmat_obj(self.spacecraft)) # update FiniteBurn's associated Spacecraft
- gpy.FiniteBurn.SetSpacecraftToManeuver(self.burn, gpy.extract_gmat_obj(self.spacecraft)) # update FiniteBurn's associated Spacecraft
+ gpy.FiniteBurn.SetSpacecraftToManeuver(self.burn, gpy.extract_gmat_obj(
+ self.spacecraft)) # update FiniteBurn's associated Spacecraft
self.Initialize()
diff --git a/gmat_py_simple/executive.py b/gmat_py_simple/executive.py
index 5d27e34..b144361 100644
--- a/gmat_py_simple/executive.py
+++ b/gmat_py_simple/executive.py
@@ -1,13 +1,10 @@
from __future__ import annotations
import gmat_py_simple as gpy
-from load_gmat import gmat
-from gmat_py_simple import GmatCommand
+from gmat_py_simple import gmat
-import sys
-
-def RunMission(mcs: list[GmatCommand]) -> int:
+def RunMission(mcs: list[gpy.GmatCommand]) -> int:
# Shortcut for running missions
return gpy.Moderator().RunMission(mcs)
@@ -199,13 +196,13 @@ def GetFirstCommand(self):
def Initialize(self):
self.gmat_obj.Initialize()
- def InsertCommand(self, command_to_insert: GmatCommand, preceding_command: GmatCommand):
+ def InsertCommand(self, command_to_insert: gpy.GmatCommand, preceding_command: gpy.GmatCommand):
return self.gmat_obj.InsertCommand(command_to_insert, preceding_command)
def RemoveObject(self, obj_type: int, name: str, del_only_if_not_used: bool = True) -> bool:
return self.gmat_obj.RemoveObject(obj_type, name, del_only_if_not_used)
- def RunMission(self, mission_command_sequence: list[GmatCommand]) -> int:
+ def RunMission(self, mission_command_sequence: list[gpy.GmatCommand]) -> int:
"""
Run the mission command sequence
@@ -214,6 +211,7 @@ def RunMission(self, mission_command_sequence: list[GmatCommand]) -> int:
:param mission_command_sequence:
:return:
"""
+
def update_command_objs_post_run(command_sequence: list[gpy.GmatCommand | gmat.GmatCommand]):
propagate_commands: list[gpy.Propagate] = [] # start a list of Propagates so their sats can be updated
target_commands: list[gpy.Target] = [] # start a list of Targets for checking convergence
diff --git a/gmat_py_simple/hardware.py b/gmat_py_simple/hardware.py
index f431f99..e3bfc73 100644
--- a/gmat_py_simple/hardware.py
+++ b/gmat_py_simple/hardware.py
@@ -5,7 +5,7 @@
import numpy as np
-from load_gmat import gmat
+from gmat_py_simple import gmat
import gmat_py_simple as gpy
from gmat_py_simple import GmatObject
diff --git a/gmat_py_simple/import_lib.py b/gmat_py_simple/import_lib.py
new file mode 100644
index 0000000..313c421
--- /dev/null
+++ b/gmat_py_simple/import_lib.py
@@ -0,0 +1,40 @@
+import os
+
+
+def _gmat_path() -> str:
+ """Import GMAT's built-in gmat library."""
+ gmat_directory: str
+ try:
+ gmat_directory = _gmat_path_from_env()
+ except ValueError:
+ try:
+ gmat_directory = _gmat_path_from_config_file()
+ except FileNotFoundError:
+ raise
+
+ return gmat_directory
+
+
+def _gmat_path_from_env() -> str:
+ """Gets the path to the GMAT directory from the "GMAT" environment variable."""
+ try:
+ gmat_env: str = os.environ['GMAT']
+
+ except KeyError:
+ raise ValueError('"GMAT" environment variable not set.')
+
+ return gmat_env
+
+
+def _gmat_path_from_config_file() -> str:
+ """Gets the path to the GMAT directory from a configuration file."""
+
+ config_file = 'gmat_path.txt'
+
+ with open(config_file, 'r') as f:
+ gmat_directory: str = f.readline()
+
+ return gmat_directory
+
+
+gmat_path: str = _gmat_path()
diff --git a/gmat_py_simple/interpreter.py b/gmat_py_simple/interpreter.py
index 82f67c4..f38b38c 100644
--- a/gmat_py_simple/interpreter.py
+++ b/gmat_py_simple/interpreter.py
@@ -1,7 +1,8 @@
from __future__ import annotations
import gmat_py_simple as gpy
-from load_gmat import gmat
+
+from gmat_py_simple import gmat
class Validator:
@@ -31,4 +32,3 @@ def SetSolarSystem(self, ss: gmat.SolarSystem = gmat.GetSolarSystem()) -> bool:
def ValidateCommand(self, command: gpy.GmatCommand | gmat.GmatCommand):
return gpy.extract_gmat_obj(self).ValidateCommand(gpy.extract_gmat_obj(command))
-
diff --git a/gmat_py_simple/load_gmat.py b/gmat_py_simple/load_gmat.py
new file mode 100644
index 0000000..a028ec4
--- /dev/null
+++ b/gmat_py_simple/load_gmat.py
@@ -0,0 +1,26 @@
+import errno
+import os
+import sys
+import types
+
+from gmat_py_simple.import_lib import gmat_path
+
+api_startup = "api_startup_file.txt"
+gmat_bin_path = gmat_path + "/bin"
+startup = gmat_bin_path + "/" + api_startup
+
+if os.path.exists(startup):
+ print(f'Running GMAT in {gmat_path}')
+
+ sys.path.insert(1, gmat_bin_path)
+
+ gmat: types.ModuleType = __import__('gmatpy')
+
+ gmat.Setup(startup)
+
+else:
+ message: str = ("Please set up a GMAT startup file named " + api_startup +
+ " in the " + gmat_bin_path + " folder.")
+
+ raise FileNotFoundError(
+ errno.ENOENT, message, startup)
diff --git a/gmat_py_simple/orbit.py b/gmat_py_simple/orbit.py
index fd56e94..e85bfb9 100644
--- a/gmat_py_simple/orbit.py
+++ b/gmat_py_simple/orbit.py
@@ -1,7 +1,5 @@
from __future__ import annotations
-from load_gmat import gmat
-
from gmat_py_simple.basics import GmatObject
from gmat_py_simple.utils import *
diff --git a/gmat_py_simple/parameter.py b/gmat_py_simple/parameter.py
index 701026d..69fa16c 100644
--- a/gmat_py_simple/parameter.py
+++ b/gmat_py_simple/parameter.py
@@ -1,7 +1,8 @@
from __future__ import annotations
import gmat_py_simple as gpy
-from load_gmat import gmat
+
+from gmat_py_simple import gmat
# def CreateParameter(param_type: str, name: str) -> Parameter:
diff --git a/gmat_py_simple/solver.py b/gmat_py_simple/solver.py
index bf74718..9028f08 100644
--- a/gmat_py_simple/solver.py
+++ b/gmat_py_simple/solver.py
@@ -1,6 +1,5 @@
from __future__ import annotations
-from load_gmat import gmat
import gmat_py_simple as gpy
diff --git a/gmat_py_simple/spacecraft.py b/gmat_py_simple/spacecraft.py
index 9fc20d8..08cf3ca 100644
--- a/gmat_py_simple/spacecraft.py
+++ b/gmat_py_simple/spacecraft.py
@@ -1,7 +1,7 @@
from __future__ import annotations
import gmat_py_simple as gpy
-from load_gmat import gmat
+from gmat_py_simple import gmat
from gmat_py_simple.basics import GmatObject
from gmat_py_simple.orbit import OrbitState
@@ -585,7 +585,8 @@ def from_dict(cls, ep_tank_dict: dict) -> gpy.ElectricTank | None:
class Thruster(GmatObject):
def __init__(self, fuel_type: str, name: str, tanks: str | gpy.Tank | gmat.Tank | list[gpy.Tank] |
- list[gmat.FuelTank], mix_ratio: int | float | list[int | float] = None):
+ list[gmat.FuelTank],
+ mix_ratio: int | float | list[int | float] = None):
self.fuel_type = fuel_type
self.thruster_type = f'{self.fuel_type}Thruster' # 'ChemicalThruster' or 'ElectricThruster'
super().__init__(self.thruster_type, name)
@@ -673,7 +674,7 @@ def decrement_mass(self, true_false: bool):
class ChemicalThruster(Thruster):
def __init__(self, name: str, tanks: str | gpy.ChemicalTank | gmat.ChemicalTank |
- list[gpy.ChemicalTank] | list[gmat.ChemicalTank]):
+ list[gpy.ChemicalTank] | list[gmat.ChemicalTank]):
super().__init__('Chemical', name, tanks)
self.Validate()
@@ -691,7 +692,7 @@ def from_dict(cls, cp_thr_dict: dict) -> gpy.ChemicalThruster | None:
class ElectricThruster(Thruster):
def __init__(self, name: str, tanks: str | gpy.ElectricTank | gmat.ElectricTank |
- list[gpy.ElectricTank] | list[gmat.ElectricTank]):
+ list[gpy.ElectricTank] | list[gmat.ElectricTank]):
super().__init__('Electric', name, tanks)
self.Initialize()
diff --git a/gmat_py_simple/utils.py b/gmat_py_simple/utils.py
index a892150..ef5ff59 100644
--- a/gmat_py_simple/utils.py
+++ b/gmat_py_simple/utils.py
@@ -1,7 +1,7 @@
from __future__ import annotations
import gmat_py_simple as gpy
-from load_gmat import gmat
+from gmat_py_simple import gmat
import sys
from io import StringIO
diff --git a/load_gmat.py b/load_gmat_OLD.py
similarity index 100%
rename from load_gmat.py
rename to load_gmat_OLD.py
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..392f6e4
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,23 @@
+[build-system]
+requires = ["hatchling >= 1.26", "numpy >= 2.0.0"]
+build-backend = "hatchling.build"
+
+[project]
+name = "gmat_py_simple"
+version = "0.4.4"
+authors = [
+ { name="William Easdown Babb", email="weasdown99@gmail.com" },
+]
+description = "An extra wrapper for the GMAT Python API to simplify setting up mission simulations."
+readme = "README.md"
+requires-python = ">=3.9"
+classifiers = [
+ "Programming Language :: Python :: 3",
+ "Operating System :: OS Independent",
+]
+license = "MIT"
+license-files = ["LICEN[CS]E*"]
+
+[project.urls]
+Homepage = "https://github.com/weasdown/GMAT-Python-simple/"
+Issues = "https://github.com/weasdown/GMAT-Python-simple/issues/"
\ No newline at end of file