Skip to content

Releases: latchbio/latch

v0.9.2

26 May 07:04
Compare
Choose a tag to compare

Fixes pyarrow conflict on M1 Mac builds.

v0.9.0

21 May 17:03
Compare
Choose a tag to compare

SDK Workflows use an open-source base container image.

Base image code can be found here.

v0.8.3

19 May 22:25
Compare
Choose a tag to compare

[bug]

  • forgot import into types

v0.8.2

19 May 22:11
Compare
Choose a tag to compare

[bugs]

  • large task memory requirements

[features]

  • medium task added

v0.8.1

08 May 22:43
Compare
Choose a tag to compare

Fixes LatchDir remote path copy on parameter ingestion. Tasks using LatchDir typed parameters will not function correctly prior to this patch.

v0.8.0

07 May 21:11
Compare
Choose a tag to compare

Local Development

Here is an example of a minimal wf/__init__.py file that demonstrates local
execution:

from pathlib import Path

from latch import small_task, workflow
from latch.types import LatchFile


@small_task
def foo(a: LatchFile) -> LatchFile:

    with open(a) as f:
        print(f.read())

    b = Path("new.txt").resolve()
    with open(b, "w") as f:
        f.write("somenewtext")

    return LatchFile(str(b), "latch:///remote_location/a.txt")


@workflow
def bar(a: LatchFile) -> LatchFile:
    """
    ...
    """
    return foo(a=a)


if __name__ == "__main__":
    bar(a=LatchFile("/root/reads.fa"))

Read more at https://docs.latch.bio/basics/local_development.html

v0.7.1

30 Apr 17:02
68d7bc2
Compare
Choose a tag to compare

There is no default certificate authority for the Python installation on OSX.

This means our python client is unable to verify certificates to initiate SSL/TLS connections. This patch creates a default root certificate authority to solve this problem.

0.7.0

26 Mar 21:45
Compare
Choose a tag to compare

latch register now commits workflow code to Github.

v0.6.2

19 Mar 22:53
Compare
Choose a tag to compare

This version introduces four new CLI subcommands:

latch open

A Latch SDK user can now open a remote file in their browser directly from the command line.

Usage: latch open [OPTIONS] REMOTE_FILE

  Open a remote file in the browser

  Visit docs.latch.bio to learn more.

This allows a user to view any of their files in Latch Console using a single CLI command - for example, $ latch open welcome/welcome.pdf will open welcome.pdf in Latch Console in the user's browser. In general, the user can provide as input either

  • a prefixed absolute path (e.g. latch:///welcome/welcome.pdf)
  • an absolute path without a prefix (e.g. /welcome/welcome.pdf)
  • a path relative to the root of the user's filesystem (e.g. welcome/welcome.pdf)

Note that the path specified must be valid and must point to a file, i.e. this command will throw an error if the argument is a remote directory.

latch mkdir

A Latch SDK user can now create remote directories directly from the command line.

Usage: latch mkdir [OPTIONS] REMOTE_DIRECTORY

  Creates a new remote directory

  Visit docs.latch.bio to learn more.

For example, $ latch mkdir welcome/example_dir will create a new directory called example_dir inside the user's welcome directory (assuming it exists). In general, the user can provide as input either

  • a prefixed absolute path (e.g. latch:///welcome/example_dir)
  • an absolute path without a prefix (e.g. /welcome/example_dir)
  • a path relative to the root of the user's filesystem (e.g. welcome/example_dir)

Note that all parent directories in the specified remote path must already exist. For example, something like $ latch mkdir welcome/doesnt_exist/example_dir will throw an error. Moreover, if a directory already exists at the specified remote path, this command will create an indexed version of the directory. For example, the sequence of commands

$ latch mkdir welcome/example_dir
$ latch mkdir welcome/example_dir

will create two different directories inside of welcome, one called example_dir and the other called example_dir 1.

latch touch

A Latch SDK user can now create remote files directly from the command line.

Usage: latch touch [OPTIONS] REMOTE_FILE

  Creates an empty text file.

  Visit docs.latch.bio to learn more.

For example, $ latch touch welcome/example.txt will create a new text file called example.txt in the user's welcome directory (assuming it exists). In general, the user can provide as input either

  • a prefixed absolute path (e.g. latch:///welcome/example.txt)
  • an absolute path without a prefix (e.g. /welcome/example.txt)
  • a path relative to the root of the user's filesystem (e.g. welcome/example.txt)

Much like mkdir, all parent directories in the specified remote path must already exist. For example, something like $ latch touch welcome/doesnt_exist/example.txt will throw an error. However, if a file already exists at the specified remote path, this command will overwrite the contents of that file instead of creating an indexed version.

latch rm

A Latch SDK user can now remove remote entities directly from the command line.

Usage: latch rm [OPTIONS] REMOTE_PATH

  Deletes a remote entity.

  Visit docs.latch.bio to learn more.

For example, $ latch rm welcome/welcome.pdf will delete the welcome.pdf file (assuming it exists) from the user's welcome directory. In general, the user can provide as input either

  • a prefixed absolute path (e.g. latch:///welcome/welcome.pdf)
  • an absolute path without a prefix (e.g. /welcome/welcome.pdf)
  • a path relative to the root of the user's filesystem (e.g. welcome/welcome.pdf)

The path may also point to a directory, in which case latch rm will behave like rm -r and deleting the directory as well as all of its contents. For safety, a user is not allowed to delete their root directory, and the command will throw an error if this is attempted. The command will also throw an error if the path being specified doesn't exist.

Other changes:

  • latch cp now supports copying directories in either direction

v0.5.1

17 Mar 17:54
Compare
Choose a tag to compare

This version introduces latch get-params <wf-name> to generate a dictionary of python-native parameters from any workflow. The resulting python file can be passed to the latch execute *.py subcommand to execute workflows from the command line.

Example Usage

First get the name of a workflow you want to generate parameters for.

$ latch get-wf | grep alphafold
59636	latch.alphafold_wf             	v2.1.0+0

Then construct your parameter file:

$ latch get-params latch.alphafold_wf
Successfully generated python param map named latch.alphafold_wf.params.py with version latest
 Run `latch execute latch.alphafold_wf.params.py` to execute it.

$ latch execute latch.alphafold_wf.params.py
Successfully launched workflow named latch.alphafold_wf with version latest.

Example Param File

latch.alphafold_wf.params.py

"""Run `latch execute latch.alphafold_wf.params.py` to execute this workflow"""

from latch.types import LatchFile
from latch.types import LatchDir

params = {
    "_name": "latch.alphafold_wf", # Don't edit this value.
    "db": "full", # DEFAULT. <class 'str'>
    "fasta_file": LatchFile("latch:///foobar"), # <class 'latch.types.file.LatchFile'>
    "is_prokaryote": False, # DEFAULT. <class 'bool'>
    "max_template_date": "2022-01-01", # DEFAULT. <class 'str'>
    "mode": "monomer_single", # DEFAULT. <class 'str'>
    "output_dir": LatchDir("latch:///foobar"), # <class 'latch.types.directory.LatchDir'>
    "output_name": "run1", # DEFAULT. <class 'str'>
    "weights_download_url": "https://storage.googleapis.com/alphafold/alphafold_params_2021-10-27.tar", # DEFAULT. <class 'str'>
}