<commit_before>from __future__ import division, print_function, absolute_import
import numpy as np
import warnings
from phidl.device_layout import Path, CrossSection, _rotate_points


def arc(radius = 10, angle = 90, num_pts = 720):
    """ Create a circular arc Path

    Parameters
    ----------
    radius : int or float
        Radius of arc
    angle : int or float
        Total angle of arc
    num_pts : int
        Number of points used per 360 degrees

    Returns
    -------
    Path
        A Path object with the specified arc
    """
    num_pts = abs(int(num_pts*angle/360))
    t = np.linspace(-90*np.pi/180, (angle-90)*np.pi/180, num_pts)
    x = radius*np.cos(t)
    y = radius*(np.sin(t)+1)
    points = np.array((x,y)).T * np.sign(angle)

    P = Path()
    # Manually add points & adjust start and end angles
    P.points = points
    P.start_angle = 0
    P.end_angle = angle
    return P


def straight(length = 5, num_pts = 2):
    """ Creates a straight Path

    Parameters
    ----------
    length : int or float
        Total length of straight path
    num_pts : int
        Number of points along Path

    Returns
    -------
    Path
        A Path object with the specified straight section
    """
    x = np.linspace(0, length, num_pts)
    y = x*0
    points = np.array((x,y)).T

    P = Path()
    P.append(points)
    return P


#### Euler bends<commit_msg>Change pp.straight(num_pts = 100) default argument back<commit_after>from __future__ import division, print_function, absolute_import
import numpy as np
import warnings
from phidl.device_layout import Path, CrossSection, _rotate_points


def arc(radius = 10, angle = 90, num_pts = 720):
    """ Create a circular arc Path

    Parameters
    ----------
    radius : int or float
        Radius of arc
    angle : int or float
        Total angle of arc
    num_pts : int
        Number of points used per 360 degrees

    Returns
    -------
    Path
        A Path object with the specified arc
    """
    num_pts = abs(int(num_pts*angle/360))
    t = np.linspace(-90*np.pi/180, (angle-90)*np.pi/180, num_pts)
    x = radius*np.cos(t)
    y = radius*(np.sin(t)+1)
    points = np.array((x,y)).T * np.sign(angle)

    P = Path()
    # Manually add points & adjust start and end angles
    P.points = points
    P.start_angle = 0
    P.end_angle = angle
    return P


def straight(length = 5, num_pts = 100):
    """ Creates a straight Path

    Parameters
    ----------
    length : int or float
        Total length of straight path
    num_pts : int
        Number of points along Path

    Returns
    -------
    Path
        A Path object with the specified straight section
    """
    x = np.linspace(0, length, num_pts)
    y = x*0
    points = np.array((x,y)).T

    P = Path()
    P.append(points)
    return P


#### Euler bends
{'fraction_non_alphanumeric': 0.11267605633802817, 'fraction_numerical': 0.022183098591549297, 'mean_word_length': 2.149667405764967, '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': '1012358', 'n_tokens_mistral': 938, 'n_tokens_neox': 872, 'n_words': 296}