Skip to content

Commit

Permalink
Fixes and minor convenience improvements from an example run-through.…
Browse files Browse the repository at this point in the history
… v0.1.1.
  • Loading branch information
cgevans committed Aug 11, 2021
1 parent 5d81802 commit a15453e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
8 changes: 3 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ long_description_content_type = text/markdown; charset=UTF-8; variant=GFM
url = https://github.com/cgevans/qslib/
# Add here related links, for example:
project_urls =
Documentation = https://alhambra.readthedocs.org/
Source = https://github.com/pyscaffold/pyscaffold/
Changelog = pyscaffold.org/en/latest/changelog.html
Documentation = https://qslib.readthedocs.org/
Source = https://github.com/cgevans/qslib/
Changelog = https://github.com/cgevans/qslib/blob/main/CHANGELOG.md
Tracker = https://github.com/cgevans/qslib/issues
# Conda-Forge = https://anaconda.org/conda-forge/pyscaffold
Download = https://github.com/cgevans/qslib/releases
# Twitter = https://twitter.com/PyScaffold

# Change if running only on Windows, Mac or Linux (comma-separated)
platforms = any
Expand Down
4 changes: 2 additions & 2 deletions src/qslib/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .machine import Machine
from .experiment import Experiment, PlateSetup, Protocol, Stage, Step, RunStatus, MachineStatus
from .machine import Machine, MachineStatus, RunStatus
from .experiment import Experiment, PlateSetup, Protocol, Stage, Step
from . import tcprotocol as tc

__all__ = (
Expand Down
4 changes: 2 additions & 2 deletions src/qslib/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def df_from_readings(
columns=pd.MultiIndex.from_tuples(
[("time", "timestamp")]
+ [
(f"{r}{c:02}", v)
(f"{r}{c}", v)
for v in ["fl", "rt", "st"]
for r in "ABCDEFGH"
for c in range(1, 13)
Expand All @@ -285,7 +285,7 @@ def df_from_readings(
pd.MultiIndex.from_tuples(
[("time", v) for v in ["seconds", "hours", "timestamp"]]
+ [
(f"{r}{c:02}", v)
(f"{r}{c}", v)
for r in "ABCDEFGH"
for c in range(1, 13)
for v in ["fl", "rt", "st"]
Expand Down
4 changes: 2 additions & 2 deletions src/qslib/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,7 +1565,7 @@ def data_for_sample(self, sample: str):
pd.Dataframe
Slice of welldata. Will have multiple wells if sample is in multiple wells.
"""
wells = [f"{x[0]}{int(x[1:])}" for x in self.plate_setup.sample_wells[sample]]
wells = ['time'] + [f"{x[0]}{int(x[1:])}" for x in self.plate_setup.sample_wells[sample]]
x = self.welldata.loc[:, wells]
return x

Expand Down Expand Up @@ -1629,7 +1629,7 @@ def _update_from_log(self):
# beginning of the log as an info command, with quote.message. Let's
# try to grab it!
if m := re.match(
r"^Info (?:[\d.]+) (<quote.message>.*?</quote.message>)", msglog, re.DOTALL
r"^Info (?:[\d.]+) (<quote.message>.*?</quote.message>)", msglog, re.DOTALL | re.MULTILINE
):
# We can get the prot name too, and sample volume!
rp = re.search(
Expand Down
9 changes: 8 additions & 1 deletion src/qslib/tcprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import numpy as np
from .util import *
import logging
from copy import deepcopy

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -506,6 +507,9 @@ def all_times(self) -> np.ndarray:
alltimes[1::2] = d["end_time"]
return alltimes

def copy(self) -> Protocol:
return deepcopy(self)

@property
def all_temperatures(self) -> np.ndarray:
"An array of temperature settings at `all_times`."
Expand Down Expand Up @@ -992,7 +996,10 @@ def _from_command_dict(cls, d):
temp_incrementcycle=1,
)
c.collect = True
c.filters = [FilterSet.fromstring(x) for x in d["body"][1]["args"]]
if "args" in d["body"][1].keys():
c.filters = [FilterSet.fromstring(x) for x in d["body"][1]["args"]]
else:
c.filters = []
for k, v in d["body"][2]["opts"].items():
k = k.lower()
if "increment" in k:
Expand Down

0 comments on commit a15453e

Please sign in to comment.