<commit_before>package etomica;

import etomica.atom.AtomArrayList;
import etomica.integrator.IntegratorHard;
import etomica.nbr.AtomSequencerNbr;

/**
 * Class holding static fields that determine whether debugging is on, how
 * much, what types and what (if anything) should be looked at specifically.
 * @author andrew
 */

public final class Debug {

	/**
	 * true if any debugging should be done
	 */
	public static final boolean ON = false;
        
	/**
	 * what step of the integrator deubgging should start from.
	 * to get debugging to start before Integrator.run, explicitly
	 * set DEBUG_NOW to true. 
	 */
	public static final int START = 0;
	
	/**
	 * what step of the integrator should the simulation bail
	 * set this to prevent Etomica from running for a long time while 
	 * outputting debugging information (potentially filling up the disk)  
	 */
	public static final int STOP = -1;
	
	/**
	 * debugging level.  A higher level means more debugging
	 * performance should suffer as the level goes up, and
	 * finding useful information might get difficult.
	 */
	public static final int LEVEL = 1;
	
	/**
	 * leaf atom number of first atom of interest.  The atom is the nth leaf atom 
	 * in a phase (set by calling setAtoms(phase)) More debugging information will be
	 * printed out about this particular atom.  -1 indicates no particular atom.
	 */
	public static final int ATOM1_NUM = 4;
	
	/**
	 * leaf atom number of second atom of interest.  This is often used in conjunction with 
	 * ATOM1_INDEX to collect information about a pair of atoms.  -1 indicates no
	 * particular atom.  
	 */
	public static final int ATOM2_NUM = 508;
	
    /**
     * index of phase of interest.  -1 indicates no particular phase.
     */
    public static final int PHASE_INDEX = 0;
    
	/**
	 * true if debugging is currently enabled (when the integrator reaches step START) 
	 */
	public static boolean DEBUG_NOW = true;

    /**
     * determines whether this atom is set to be debugged
     * (via ATOMx_NUM and setAtoms(phase)).
     * @param atom Atom to be checked for debugging status
     * @return true if the atom should be debugged
     */
    public static boolean thisAtom(Atom atom) {
        if (atom == ATOM1 || atom == ATOM2) return true;
        return false;
    }

	/**
	 * determines whether any of the atoms in the given array are set to be debugged
	 * (via ATOMx_NUM and setAtoms(phase)).
	 * @param atoms array of atoms to be checked for debugging status
	 * @return true if any of the atoms in the atoms array should be debugged
	 */
	public static boolean anyAtom(Atom[] atoms) {
		for (int i=0; i<atoms.length; i++) {
			if (atoms[i] == ATOM1 || atoms[i] == ATOM2) return true;
		}
		return false;
	}

	/**<commit_msg>handle arrays with only one element in anyAtom<commit_after>package etomica;

import etomica.atom.AtomArrayList;
import etomica.integrator.IntegratorHard;
import etomica.nbr.AtomSequencerNbr;

/**
 * Class holding static fields that determine whether debugging is on, how
 * much, what types and what (if anything) should be looked at specifically.
 * @author andrew
 */

public final class Debug {

	/**
	 * true if any debugging should be done
	 */
	public static final boolean ON = false;
        
	/**
	 * what step of the integrator deubgging should start from.
	 * to get debugging to start before Integrator.run, explicitly
	 * set DEBUG_NOW to true. 
	 */
	public static final int START = 4255;
	
	/**
	 * what step of the integrator should the simulation bail
	 * set this to prevent Etomica from running for a long time while 
	 * outputting debugging information (potentially filling up the disk)  
	 */
	public static final int STOP = 4265;
	
	/**
	 * debugging level.  A higher level means more debugging
	 * performance should suffer as the level goes up, and
	 * finding useful information might get difficult.
	 */
	public static final int LEVEL = 3;
	
	/**
	 * leaf atom number of first atom of interest.  The atom is the nth leaf atom 
	 * in a phase (set by calling setAtoms(phase)) More debugging information will be
	 * printed out about this particular atom.  -1 indicates no particular atom.
	 */
	public static final int ATOM1_NUM = 13;
	
	/**
	 * leaf atom number of second atom of interest.  This is often used in conjunction with 
	 * ATOM1_INDEX to collect information about a pair of atoms.  -1 indicates no
	 * particular atom.  
	 */
	public static final int ATOM2_NUM = 18;
	
    /**
     * index of phase of interest.  -1 indicates no particular phase.
     */
    public static final int PHASE_INDEX = 0;
    
	/**
	 * true if debugging is currently enabled (when the integrator reaches step START) 
	 */
	public static boolean DEBUG_NOW = false;

    /**
     * determines whether this atom is set to be debugged
     * (via ATOMx_NUM and setAtoms(phase)).
     * @param atom Atom to be checked for debugging status
     * @return true if the atom should be debugged
     */
    public static boolean thisAtom(Atom atom) {
        if (atom == ATOM1 || atom == ATOM2) return true;
        return false;
    }

	/**
	 * determines whether any of the atoms in the given array are set to be debugged
	 * (via ATOMx_NUM and setAtoms(phase)).
	 * @param atoms array of atoms to be checked for debugging status
	 * @return true if any of the atoms in the atoms array should be debugged
	 */
	public static boolean anyAtom(Atom[] atoms) {
		for (int i=0; i<atoms.length; i++) {
			if ((ATOM1 != null && atoms[i] == ATOM1) || (ATOM2 != null && atoms[i] == ATOM2)) return true;
		}
		return false;
	}

	/**
{'fraction_non_alphanumeric': 0.07681289167412712, 'fraction_numerical': 0.008236347358997314, 'mean_word_length': 3.0158159597411935, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2712121', 'n_tokens_mistral': 1691, 'n_tokens_neox': 1535, 'n_words': 731}