<commit_before>
import numpy as np
from TSatPy.Actuator import Actuator

print('Actuator Usage')

configs = [{'type': 'fan', 'args': {'name': 'CW', 'center': (2, -2, 0),
  'direction': (-1, -1, 0), 'F': 10}
},{'type': 'fan', 'args': {'name': 'CCW1', 'center': (-2, 2, 0),
  'direction': (-1, -1, 0), 'F': 10}
},{'type': 'fan', 'args': {'name': 'CCW2', 'center': (-2, 2, 0),
  'direction': (-1, -1, 0), 'F': 10}
},{'type': 'fan', 'args': {'name': 'NY', 'center': (5, 0, 0),
  'direction': (0, 0, -1), 'F': 10}
},{'type': 'fan', 'args': {'name': 'NX', 'center': (0, 5, 0),
  'direction': (0, 0, -1), 'F': 10}}]


def set_level(act, power_level):
    print 'Setting power level=%g for: %s' % (power_level, act)


def setup_actuators(configs):
    act = Actuator()
    for config in configs:
        act.add(config['type'], set_level, config['args'])
    return act


def main():
    act = setup_actuators(configs)
    print act
    M = np.mat([3, 11, 4]).T
    print("\nRequest moment: %s" % (M.T))
    print
    print("\nApplied moment: %s" % (act.request_moment(M).T))
    return 0


if __name__ == '__main__':
    main()


# Prints Out
# Actuator Usage
# Actuator
#  <Fan CW moment=(0, -0, -4)>
#  <Fan CCW1 moment=(0, 0, 4)>
#  <Fan CCW2 moment=(0, 0, 4)>
#  <Fan NY moment=(-0, 5, 0)>
#  <Fan NX moment=(-5, 0, 0)>

# Request moment: [[ 3 11  4]]

# Setting power level=1 for: <Fan NY moment=(-0, 5, 0)>
# Setting power level=0.5 for: <Fan CCW1 moment=(0, 0, 4)>
# Setting power level=0.5 for: <Fan CCW2 moment=(0, 0, 4)>

# Applied moment: [[ 0.  5.  4.]]<commit_msg>Update actuator sample<commit_after>
import numpy as np
from TSatPy.Actuator import Actuator

print('Actuator Usage')

configs = [{'type': 'fan', 'args': {'name': 'CW',
  'center': (0.2474, -0.2474, 0), 'direction': (-1, -1, 0), 'F': 0.08}
},{'type': 'fan', 'args': {'name': 'CCW1',
  'center': (-0.2474, 0.2474, 0), 'direction': (-1, -1, 0), 'F': 0.08}
},{'type': 'fan', 'args': {'name': 'CCW2',
  'center': (-0.2474, -0.2474, 0), 'direction': (1, -1, 0), 'F': 0.08}
},{'type': 'fan', 'args': {'name': 'NY', 'center': (0.25, 0, 0),
  'direction': (0, 0, 1), 'F': 0.08}
},{'type': 'fan', 'args': {'name': 'NX', 'center': (0, 0.25, 0),
  'direction': (0, 0, 1), 'F': 0.08}}]


def set_level(act, power_level):
    print 'Setting power level=%g for: %s' % (power_level, act)


def setup_actuators(configs):
    act = Actuator()
    for config in configs:
        act.add(config['type'], set_level, config['args'])
    return act


def main():
    act = setup_actuators(configs)
    print(act)
    M = np.mat([0.03, 0.11, 0.07]).T
    print("\nRequest moment: %s" % (M.T))
    print
    print("\nApplied moment: %s" % (act.request_moment(M).T))
    return 0


if __name__ == '__main__':
    main()


# Prints Out
# Actuator
#  <Fan CW moment=(0, -0, -0.0279901)>
#  <Fan CCW1 moment=(0, 0, 0.0279901)>
#  <Fan CCW2 moment=(0, 0, 0.0279901)>
#  <Fan NY moment=(0, -0.02, 0)>
#  <Fan NX moment=(0.02, 0, 0)>

# Request moment: [[ 0.03  0.11  0.07]]

# Setting power level=1 for: <Fan NX moment=(0.02, 0, 0)>
# Setting power level=1 for: <Fan CCW1 moment=(0, 0, 0.0279901)>
# Setting power level=1 for: <Fan CCW2 moment=(0, 0, 0.0279901)>

# Applied moment: [[ 0.02        0.          0.05598023]]
{'fraction_non_alphanumeric': 0.2471634467954615, 'fraction_numerical': 0.08157007053051211, 'mean_word_length': 3.511756569847856, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2359489', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1368, 'n_words': 404}