<commit_before># coding: utf-8

""" Compute Lyapunov exponents for the mean orbit fits """

from __future__ import division, print_function

__author__ = "adrn <<EMAIL>>"

# Standard library
import os

# Third-party
from astropy import log as logger
import numpy as np
import gary.dynamics as gd

# This project
import ophiuchus.potential as op

def main(path, overwrite=False):
    dt = 1.
    nsteps = 2560000 # 256 steps per orbit -- 10000 orbital periods

    path = os.path.abspath(path)
    name = os.path.basename(path)
    output_file = os.path.join(path, 'lyap.npy')
    t_output_file = os.path.join(path, 'lyap_t.npy')
    ws_output_file = os.path.join(path, 'lyap_ws.npy')

    if os.path.exists(output_file) and overwrite:
        os.remove(output_file)

    if os.path.exists(output_file):
        logger.info("Output file exists. Exiting.")

    # load initial conditions file
    w0 = np.load(os.path.join(path, 'w0.npy'))
    w0 = np.median(w0, axis=0)
    pot = op.load_potential(name)

    # compute lyapunov exponent
    lyap,t,ws = gd.fast_lyapunov_max(w0, pot, dt=dt, nsteps=nsteps)
    np.save(output_file, lyap)
    np.save(t_output_file, t)
    np.save(ws_output_file, ws)

if __name__ == "__main__":<commit_msg>change step size and which orbit to read<commit_after># coding: utf-8

""" Compute Lyapunov exponents for the mean orbit fits """

from __future__ import division, print_function

__author__ = "adrn <<EMAIL>>"

# Standard library
import os

# Third-party
from astropy import log as logger
import numpy as np
import gary.dynamics as gd

# This project
import ophiuchus.potential as op

def main(path, overwrite=False):
    dt = 2.
    nsteps = 2560000 # 256 steps per orbit -- 10000 orbital periods

    path = os.path.abspath(path)
    name = os.path.basename(path)
    output_file = os.path.join(path, 'lyap.npy')
    t_output_file = os.path.join(path, 'lyap_t.npy')
    ws_output_file = os.path.join(path, 'lyap_ws.npy')

    if os.path.exists(output_file) and overwrite:
        os.remove(output_file)

    if os.path.exists(output_file):
        logger.info("Output file exists. Exiting.")

    # load initial conditions file
    w0 = np.load(os.path.join(path, 'w0.npy'))[0] # load mean orbit
    pot = op.load_potential(name)

    # compute lyapunov exponent
    lyap,t,ws = gd.fast_lyapunov_max(w0, pot, dt=dt, nsteps=nsteps)
    np.save(output_file, lyap)
    np.save(t_output_file, t)
    np.save(ws_output_file, ws)

if __name__ == "__main__":
{'fraction_non_alphanumeric': 0.11611088790678988, 'fraction_numerical': 0.017677782241864202, 'mean_word_length': 3.5688073394495414, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, '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': '1734789', 'n_tokens_mistral': 950, 'n_tokens_neox': 884, 'n_words': 228}