def cmd_line_create_vectorized_numbered(): # pragma: no cover msg = ( 'Usage:\n' ' bdf create_vectorized_numbered IN_BDF_FILENAME [OUT_BDF_FILENAME]\n' ' bdf create_vectorized_numbered -h | --help\n' ' bdf create_vectorized_numbered -v | --version\n' '\n' 'Positional Arguments:\n' ' IN_BDF_FILENAME the model to convert\n' " OUT_BDF_FILENAME the converted model name (default=IN_BDF_FILENAME + '_convert.bdf')" '\n' 'Info:\n' ' -h, --help show this help message and exit\n' " -v, --version show program's version number and exit\n" ) if len(sys.argv) == 1: sys.exit(msg) from docopt import docopt import pyNastran ver = str(pyNastran.__version__) data = docopt(msg, version=ver) print(data) bdf_filename_in = data['IN_BDF_FILENAME'] if data['OUT_BDF_FILENAME']: bdf_filename_out = data['OUT_BDF_FILENAME'] else: base, ext = os.path.splitext(bdf_filename_in) bdf_filename_out = base + '_convert' + ext create_vectorized_numbered(bdf_filename_in, bdf_filename_out)
def test_convert_bdf(self): """tests create_vectorized_numbered""" bdf_filename_in = os.path.join(MODEL_PATH, 'elements', 'static_elements.bdf') bdf_filename_out = os.path.join(MODEL_PATH, 'elements', 'static_elements_convert.bdf') create_vectorized_numbered(bdf_filename_in, bdf_filename_out, debug=False) os.remove(bdf_filename_out)