<commit_before>from __future__ import division, print_function

from visual import arrow, vector

from operator import add
from util import interpolate, avg

class Inducer:
    """
    The abstract base class for all field inducers.
    """
    pass


class BInducer:
    """
    A magnetic (B) field inducer.

    Like inducer, this class is more or less a placeholder. It does define the
    method bfield_strength which must be implemented by all subclasses.
    """

    def bfield_at(self, P):
        """Calculate the magnetic field vector at a point."""
        raise NotImplementedError


class EInducer:
    """
    An electric (E) field inducer.

    Like inducer, this class is more or less a placeholder. It does define the
    method efield_strength which must be implemented by all subclasses.
    """

    def efield_at(self, P):
        """Calculate the electric field vector at a point."""
        raise NotImplementedError


class Field:
    """
    The abstract base class for all fields.

    All fields are callable objects; the return value is a vector denoting the
    field strength and direction at a point. Calculation of this vector must be
    implemented in every concrete subclass. It is typically the superposition
    of fields for every inducer in the field.

    Fields maintain a list of inducers called ducs.
    """

    def __init__(self, scene, ducs = [], color = (0, 1, 0)):
        self.scene = scene
        self.ducs = ducs
        self.color = color
        self.Ps = {}
<commit_msg>apparently at some point I thought abstract base classes were a good idea<commit_after>from __future__ import division, print_function

from visual import arrow, vector

from operator import add
from util import interpolate, avg

class BInducer:
    """
    A magnetic (B) field inducer.
    """

    def bfield_at(self, P):
        """Calculate the magnetic field vector at a point."""
        raise NotImplementedError


class EInducer:
    """
    An electric (E) field inducer.
    """

    def efield_at(self, P):
        """Calculate the electric field vector at a point."""
        raise NotImplementedError


class Field:
    """
    The abstract base class for all fields.

    All fields are callable objects; the return value is a vector denoting the
    field strength and direction at a point. Calculation of this vector must be
    implemented in every concrete subclass. It is typically the superposition
    of fields for every inducer in the field.

    Fields maintain a list of inducers called ducs.
    """

    def __init__(self, scene, ducs = [], color = (0, 1, 0)):
        self.scene = scene
        self.ducs = ducs
        self.color = color
        self.Ps = {}

{'fraction_non_alphanumeric': 0.06774668630338733, 'fraction_numerical': 0.0022091310751104565, 'mean_word_length': 2.7475862068965515, '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': '3037648', 'n_tokens_mistral': 754, 'n_tokens_neox': 716, 'n_words': 339}