<commit_before>from EXOSIMS.SurveySimulation.SLSQPScheduler import SLSQPScheduler
import EXOSIMS
import os
import astropy.units as u
import astropy.constants as const
import numpy as np
import pickle
import time


class tieredScheduler_SLSQP(SLSQPScheduler):
    """tieredScheduler_SLSQP_old

    This class implements a tiered scheduler that independantly schedules the observatory
    while the starshade slews to its next target.

    Args:
        coeffs (iterable 7x1):
            Cost function coefficients: slew distance, completeness, intTime,
            deep-dive least visited ramp, deep-dive unvisited ramp, unvisited ramp,
            and least-visited ramp
        occHIPs (iterable nx1):
            List of star HIP numbers to initialize occulter target list.
        topstars (integer):
            Number of HIP numbers to recieve preferential treatment.
        revisit_wait (float):
            Wait time threshold for star revisits.
        revisit_weight (float):
            Weight used to increase preference for coronograph revisits.
        GAPortion (float):
            Portion of mission time used for general astrophysics.
        int_inflection (boolean):
            Calculate integration time using the pre-calculated integration time curves.
            Default is False.
        GA_simult_det_fraction (float):
            Fraction of detection time to be considered as GA time.
        promote_hz_stars (boolean):
            Flag that allows promotion of targets with planets in the habitable zone
            to the occulter target list.
        phase1_end (int):
            Number of days to wait before the end of phase 1, when phase 1 ends,
            target promotion begins.
        n_det_remove (int):
            Minimum number of visits with no detections required to filter off star
        n_det_min (int):
            Minimum number of detections required for promotion
        occ_max_visits (int):
            Number of maximum visits to a star allowed by the occulter.
        max_successful_chars (int):
            Maximum number of successful characterizations on a given star before
            it is removed from the target list.
        max_successful_dets (int):
            Maximum number of successful detections on a given star before
            it is removed from the target list.
        nmax_promo_det (int):
            Number of detection on a star required to be promoted regardless of
            detection occurance times.
        lum_exp (int):
            Exponent used in the luminosity weighting function.
        \*\*specs:
            user specified values
    """

    def __init__(self, coeffs=[2,1,1,8,4,1,1], occHIPs=[], topstars=0, revisit_wait=0.5,
                 revisit_weight=1.0, GAPortion=.25, int_inflection=False,
                 GA_simult_det_fraction=.07, promote_hz_stars=False, phase1_end=365,
                 n_det_remove=3, n_det_min=3, occ_max_visits=3, max_successful_chars=1,
                 max_successful_dets=4, nmax_promo_det=4, lum_exp=1, nofZ=False, **specs):

        SLSQPScheduler.__init__(self, **specs)

        #verify that coefficients input is iterable 4x1
        if not(isinstance(coeffs,(list,tuple,np.ndarray))) or (len(coeffs) != 7):
            raise TypeError("coeffs must be a 7 element iterable")

        TK = self.TimeKeeping
        TL = self.TargetList
        OS = self.OpticalSystem
        SU = self.SimulatedUniverse

        #Add to outspec<commit_msg>Docstring update<commit_after>from EXOSIMS.SurveySimulation.SLSQPScheduler import SLSQPScheduler
import EXOSIMS
import os
import astropy.units as u
import astropy.constants as const
import numpy as np
import pickle
import time


class tieredScheduler_SLSQP(SLSQPScheduler):
    """tieredScheduler_SLSQP_old

    This class implements a tiered scheduler that independantly schedules the observatory
    while the starshade slews to its next target.

    Args:
        coeffs (iterable 7x1):
            Cost function coefficients: slew distance, completeness, intTime,
            deep-dive least visited ramp, deep-dive unvisited ramp, unvisited ramp,
            and least-visited ramp
        occHIPs (iterable nx1):
            List of star HIP numbers to initialize occulter target list.
        topstars (integer):
            Number of HIP numbers to recieve preferential treatment.
        revisit_wait (float):
            Wait time threshold for star revisits.
        revisit_weight (float):
            Weight used to increase preference for coronograph revisits.
        GAPortion (float):
            Portion of mission time used for general astrophysics.
        int_inflection (boolean):
            Calculate integration time using the pre-calculated integration time curves.
            Default is False.
        GA_simult_det_fraction (float):
            Fraction of detection time to be considered as GA time.
        promote_hz_stars (boolean):
            Flag that allows promotion of targets with planets in the habitable zone
            to the occulter target list.
        phase1_end (int):
            Number of days to wait before the end of phase 1, when phase 1 ends,
            target promotion begins.
        n_det_remove (int):
            Minimum number of visits with no detections required to filter off star
        n_det_min (int):
            Minimum number of detections required for promotion
        occ_max_visits (int):
            Number of maximum visits to a star allowed by the occulter.
        max_successful_chars (int):
            Maximum number of successful characterizations on a given star before
            it is removed from the target list.
        max_successful_dets (int):
            Maximum number of successful detections on a given star before
            it is removed from the target list.
        nmax_promo_det (int):
            Number of detection on a star required to be promoted regardless of
            detection occurance times.
        lum_exp (int):
            Exponent used in the luminosity weighting function.
        nofZ (bool):
            Flag whether the fZQuads have been created
        \*\*specs:
            user specified values
    """

    def __init__(self, coeffs=[2,1,1,8,4,1,1], occHIPs=[], topstars=0, revisit_wait=0.5,
                 revisit_weight=1.0, GAPortion=.25, int_inflection=False,
                 GA_simult_det_fraction=.07, promote_hz_stars=False, phase1_end=365,
                 n_det_remove=3, n_det_min=3, occ_max_visits=3, max_successful_chars=1,
                 max_successful_dets=4, nmax_promo_det=4, lum_exp=1, nofZ=False, **specs):

        SLSQPScheduler.__init__(self, **specs)

        #verify that coefficients input is iterable 4x1
        if not(isinstance(coeffs,(list,tuple,np.ndarray))) or (len(coeffs) != 7):
            raise TypeError("coeffs must be a 7 element iterable")

        TK = self.TimeKeeping
        TL = self.TargetList
        OS = self.OpticalSystem
        SU = self.SimulatedUniverse

        #Add to outspec
{'fraction_non_alphanumeric': 0.05565783883302648, 'fraction_numerical': 0.010480101968559695, 'mean_word_length': 2.419854721549637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '4619993', 'n_tokens_mistral': 1973, 'n_tokens_neox': 1888, 'n_words': 695}