{ "info": { "author": "Bonan Zhu", "author_email": "bon.zhu@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5" ], "description": "A simple CASTEP input files parser/writer\n==========================\nThis package provide a basic framework for read/write input files of CASTEP.\nThere is already a excellent reader/writer implemented in [ase](https://gitlab.com/ase/ase) \nbut they are ortentated to work with the `Atoms` and `Calculator` classes in `ase`. \nIt also requires a CASTEP binary to exist to work.\nThis package aim to provide a more generic framework with minimum dependency for \nsimple (but important) tasks of writing and reading inputs files of CASTEP. \n\n\nUsage\n------\nThe two classes to be used for reading/writing inputs are `ParamInput` and `CellInput`.\nKeyword-value pairs can be set the same as dictionaries.\nFor example:\n\n```python\nfrom castepinput import CellInput, ParamInput\n# ParamInput is in fact just a subclass of OrderedDict\nparam = ParamInput(cut_off_energy=300, task=\"singlepoint\")\nparam[\"opt_strategy\"] = \"speed\"\n\n# Use the Block class to signal that it is a BLOCK\n# The following line sets the positions_abs\ncell = CellInput(positions_abs=Block([\"C 0 0 0\", \"C 1 0 0\"])\n```\n\nThe two classes use simple string formatting when writing out the content.\nSee the following code as example.\n```python\ncell = CellInput(snap_to_symmetry=True)\n\n# Should give 'snap_to_symmetry : True'\ncell.get_string()\n\n# Should give 'symmetry_genreate : true'\ncell['snap_to_symmetry'] = 'true'\ncell.get_string()\n\n# Not all CASTEP keyword requires a value\n# Use \"\" as the value will result just a keyword on a line\ncell['symmetry_generate'] = ''\n# Should give a string with a line 'symmetry_generate'\ncell.get_string()\n\n# Set cell and positions use the set methods\ncell.set_cell([10 ,10 , 10])\ncell.set_positions([\"O\", \"O\"], [[0, 0, 0], [1.4, 0, 0]])\n# Save to file\ncell.save(\"O2.cell\")\n```\n\nTo initialize from a existing param/cell file, use the `ParamInput.from_file` method.\n```python\ncell = CellInput.from_file(\"O2.cell\")\n# This should give [[10, 0, 0], [0, 10, 0], [0, 0, 10]]\ncell.get_cell()\n\n# The value returned should be \"\" to be consistent with setting\ncell[\"symmetry_generate\"]\n```\n\nWe also try to be smart and convert string into python types where it is possible.\nSupported types are integer, floats and 1-d arrays made of integer/floats.\nThese coversions can be avoided by using `ParamInput.from_file(filename, plain=True)` when loading files.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/bz1/castepinput", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "castepinput", "package_url": "https://pypi.org/project/castepinput/", "platform": "", "project_url": "https://pypi.org/project/castepinput/", "project_urls": { "Homepage": "https://gitlab.com/bz1/castepinput" }, "release_url": "https://pypi.org/project/castepinput/0.1.4/", "requires_dist": [ "numpy", "six" ], "requires_python": "", "summary": "A general reader writer for CASTEP inputs", "version": "0.1.4" }, "last_serial": 5257196, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "22b5874bb95cad65d58f6bdd584e3cd9", "sha256": "a49bbe85dfe3c1c3ec2ee46b513bbbad7ca30201a0cf877c36086ea91685a01c" }, "downloads": -1, "filename": "castepinput-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "22b5874bb95cad65d58f6bdd584e3cd9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12548, "upload_time": "2018-10-14T21:33:02", "url": "https://files.pythonhosted.org/packages/77/97/0750380a6728d0a5d291f9069fb3d5148d6af31bc7ac1632e315741ce600/castepinput-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4efff0cc6398d541798d5dbf3eaac0d0", "sha256": "9c7f831553af00d2b871d7fe0076ed28379f806e8f19c4e2d2d6b5e7b251d29a" }, "downloads": -1, "filename": "castepinput-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4efff0cc6398d541798d5dbf3eaac0d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10772, "upload_time": "2018-10-14T21:33:04", "url": "https://files.pythonhosted.org/packages/4e/23/fc43af6be13d85251b071e698d5777548b9dcb3345291553328240e5f4fa/castepinput-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c571625f468f6b71c76f5ffce7f4c74b", "sha256": "aa52ca9c9a82b8370918af10d27d394529dda57a88e5225c4786c3bcb3427a28" }, "downloads": -1, "filename": "castepinput-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c571625f468f6b71c76f5ffce7f4c74b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12547, "upload_time": "2018-10-14T21:49:32", "url": "https://files.pythonhosted.org/packages/4e/29/7870f779129c04b6e477f5a96ae52bc5d16e240169c0cf88b2094f8450d7/castepinput-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "63bf467c5e03d0019487d4e5e8dd5e6a", "sha256": "4c33338f7c4b274033a02fa4c553382d1317afbc0689ec32917677367b0c31d6" }, "downloads": -1, "filename": "castepinput-0.1.2.tar.gz", "has_sig": false, "md5_digest": "63bf467c5e03d0019487d4e5e8dd5e6a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10765, "upload_time": "2018-10-14T21:49:33", "url": "https://files.pythonhosted.org/packages/bc/47/ecce48cd3a3fd4b1e5ff70581573b67d687499062887402ba44f266c1451/castepinput-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6e6fa6772f7b5544ed91eac20d02be39", "sha256": "f5ad7e179e84c4793658f2e8e83b2d32291e0e7dd14a581da72c570221da51b6" }, "downloads": -1, "filename": "castepinput-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "6e6fa6772f7b5544ed91eac20d02be39", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 12545, "upload_time": "2019-03-20T22:36:14", "url": "https://files.pythonhosted.org/packages/6e/52/bd0be3d05fd0dfe50e7b82e175e599d6a0e3f87d246d9568c6d1a7ef4d87/castepinput-0.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c945a6c886bafe94f0e91e9f861fb5db", "sha256": "d2f42572e177e9686a82ded105f914e8206acf5def9391f5115279c70776d1f8" }, "downloads": -1, "filename": "castepinput-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c945a6c886bafe94f0e91e9f861fb5db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10727, "upload_time": "2019-03-20T22:36:15", "url": "https://files.pythonhosted.org/packages/b9/12/51b93ab4497a98d336d72b4e921861a49b2243960f30cd1cdce4ccd2935a/castepinput-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f3b9c9a9904c28be302a1ba2ece09d02", "sha256": "6eb9ddd82f4b5b9d17f4ff984baf17caad1c4d5bb20c80db49d41ba47d965b93" }, "downloads": -1, "filename": "castepinput-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "f3b9c9a9904c28be302a1ba2ece09d02", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12721, "upload_time": "2019-05-11T20:25:30", "url": "https://files.pythonhosted.org/packages/6f/76/2237f25bf18b4db989bae5a948a37adaebf3cd76b733d429615cb848b501/castepinput-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2b750d83f240897b602f8a3c1bb58e2", "sha256": "8e97e8167e3bd4461cd32c5fde8341c36047cb3836dd5c318b63a2fa14eba0b1" }, "downloads": -1, "filename": "castepinput-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d2b750d83f240897b602f8a3c1bb58e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10824, "upload_time": "2019-05-11T20:25:31", "url": "https://files.pythonhosted.org/packages/d6/a9/455a781e0d28eb35de079d51101c9404078ac50122654588fc5c428df80c/castepinput-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f3b9c9a9904c28be302a1ba2ece09d02", "sha256": "6eb9ddd82f4b5b9d17f4ff984baf17caad1c4d5bb20c80db49d41ba47d965b93" }, "downloads": -1, "filename": "castepinput-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "f3b9c9a9904c28be302a1ba2ece09d02", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12721, "upload_time": "2019-05-11T20:25:30", "url": "https://files.pythonhosted.org/packages/6f/76/2237f25bf18b4db989bae5a948a37adaebf3cd76b733d429615cb848b501/castepinput-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2b750d83f240897b602f8a3c1bb58e2", "sha256": "8e97e8167e3bd4461cd32c5fde8341c36047cb3836dd5c318b63a2fa14eba0b1" }, "downloads": -1, "filename": "castepinput-0.1.4.tar.gz", "has_sig": false, "md5_digest": "d2b750d83f240897b602f8a3c1bb58e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10824, "upload_time": "2019-05-11T20:25:31", "url": "https://files.pythonhosted.org/packages/d6/a9/455a781e0d28eb35de079d51101c9404078ac50122654588fc5c428df80c/castepinput-0.1.4.tar.gz" } ] }