![]() ![]() (or) put the Firetask wherever you’d like. (or) if you have access to the FireWorks source directory, put your Firetask definition anywhere in er_objects or it subdirectories - it will be automatically be found there. No further registration is needed if you use this option. ![]() Use the decorator to define your FW name (see the Appendix). There are a couple of options for registering your Firetask (you only need to do one of the below): Second, you must register your Firetask so that it can be found by the FireWorks software. If you are unfamiliar with this topic, some more details about this process can be found here, or try Googling “how does Python find modules?” You can see the locations where Python looks for code by typing import sys followed by print(sys.path). This step usually means either installing the code into your site-packages directory (where many Python tools install code) or modifying your PYTHONPATH environment variable to include the location of the Firetask. If Python cannot import your code (e.g., from the shell), neither can FireWorks. is within Python’s search path and that you can import your Firetask in a Python shell. When FireWorks bootstraps your Firetask from a database definition, it needs to know where to look for Firetasks.įirst, you need to make sure your Firetask is defined in a file location that can be found by Python, i.e. ![]() Remember you can access dict keys of “fw_spec” as well as dict keys of “self” Keep the run_task method header intact, but change the definition to your custom operation. In this case, it’s tarring and gzipping some files according to the parameters the dictionary of itself, and ignoring anything in the fw_spec. It has two sources of information: the keys in fw_spec and a dictionary of self (which includes parameters like base_name used to construct the object).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |