Source code for arve.arve

from .data      import Data
from .functions import Functions
from .planets   import Planets
from .star      import Star

import gc
import pickle

from typing import Optional

[docs] class ARVE: """ARVE main class. """ def __init__( self ): self.id : Optional[str] = None self.data : Data = Data(self) self.functions : Functions = Functions(self) self.planets : Planets = Planets(self) self.star : Star = Star(self)
[docs] def save( arve : ARVE ) -> None: """Save ARVE object. Parameters ---------- arve : ARVE ARVE object to save Returns ------- None None """ return pickle.dump(arve, open(arve.id+'.arve', 'wb'))
[docs] def load( arve : str ) -> ARVE: """Load ARVE object. Parameters ---------- arve : str ARVE file to load Returns ------- ARVE loaded ARVE object """ return pickle.load(open(arve, 'rb'))
[docs] def delete( arve : ARVE ) -> None: """Delete ARVE object. Parameters ---------- arve : ARVE ARVE object to delete Returns ------- None None """ del arve gc.collect() return None