Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Add well methods to class Microplate (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Bigelmayr <[email protected]>
Co-authored-by: Benedikt Franke <[email protected]>
  • Loading branch information
3 people authored Nov 16, 2021
1 parent 7faebd2 commit b25b1d3
Show file tree
Hide file tree
Showing 16 changed files with 7,219 additions and 2,974 deletions.
4 changes: 0 additions & 4 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
version: 1

update_configs:
- default_assignees:
- "spawnia"
default_reviewers:
- "spawnia"
directory: "/"
package_manager: "php:composer"
update_schedule: "live"
Expand Down
15 changes: 0 additions & 15 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,6 @@ branches:
dismiss_stale_reviews: true
require_code_owner_reviews: true
required_approving_review_count: 1
required_status_checks:
contexts:
- "Coding Standards"
- "Static Code Analysis"
- "Tests (php7.3, lowest)"
- "Tests (php7.3, locked)"
- "Tests (php7.3, highest)"
- "Tests (php7.3, lowest)"
- "Tests (php7.3, locked)"
- "Tests (php7.3, highest)"
- "Code Coverage"
- "Mutation Tests"
- "codecov/patch"
- "codecov/project"
strict: false
restrictions: null

labels:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ jobs:
run: vendor/bin/phpstan analyse --configuration=phpstan.neon

tests:
name: "Tests - PHP ${{ matrix.php-version }}, Illuminate ${{ matrix.illuminate }}, ${{ matrix.dependencies }}"

runs-on: ubuntu-latest

strategy:
Expand All @@ -153,12 +155,9 @@ jobs:
- highest

illuminate:
- ^6
- ^7
- ^8

name: PHP ${{ matrix.php-version }} - Illuminate ${{ matrix.illuminate }} - ${{ matrix.dependencies }}

steps:
- name: "Checkout"
uses: actions/checkout@master
Expand Down
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## v3.0.0

### Added

- Add smart methods to class `Microplate`

### Changed

- Change structure of `Microplate::$well` to `Collection<string, TWell|null>`
- Renamed class `MicroPlate` to `Microplate`

### Removed

- Removed compatibility for `illuminate/support:^6`

## v2.0.0

### Add
- Add compatibility to Illuminate\Support `^6|^7|^8`
### Added

- Add compatibility for `illuminate/support:^6|^7|^8`

### Removed

- Removed method `getWells()` from class `MicroPlate` - use `wells` property of `MicroPlate` class

## v1.0.0

### Added

- Add class `Coordinate` with diverse calculation methods to ease dealing with micro plates at MLL
- Add class `Coordinate` with diverse calculation methods to ease dealing with microplates at MLL
- Add abstract class `CoordinateSystem` with `CoordinateSystem12Well` and `CoordinateSystem96Well` as implementation
- Add class `MicroPlate` and methods `addWell` and `getWells`
49 changes: 2 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Latest Stable Version](https://poser.pugx.org/mll-lab/microplate/v/stable)](https://packagist.org/packages/mll-lab/microplate)
[![Total Downloads](https://poser.pugx.org/mll-lab/microplate/downloads)](https://packagist.org/packages/mll-lab/microplate)

PHP package to easily convert and work with microplate data
PHP package to easily work with microplate data

## Installation

Expand All @@ -18,52 +18,7 @@ composer require mll-lab/microplate

## Usage

### Create Coordinate

```php
//define the coordinate system to work with
$coordinateSystem = new CoordinateSystem96Well();

// create by row and column
$coordinate = new Coordinate('C', 7, $coordinateSystem);

// create by string coordinate
$coordinate = Coordinate::fromString('C7', $coordinateSystem);

// Automatic evaluation if the row and column are valid within the coordinate system
$coordinate = new Coordinate('X', 7, $coordinateSystem);
// throws ´InvalidArgumentException: Expected a row with value of A,B,C,D,E,F,G,H, got X.´
```
### Calculate the numeric position of a Coordinate
```php
$coordinate = new Coordinate('C', 7, new CoordinateSystem96Well());

// calulate the numeric position by providing the FlowDirection
$coordinate->position(FlowDirection::COLUMN()); // 51
$coordinate->position(FlowDirection::ROW()); // 31
```

### Creating a MicroPlate, adding wells, retrieving them

```php
$coordinateSystem = new CoordinateSystem96Well();

$microPlate = new MicroPlate($coordinateSystem);

$microPlateCoordinate1 = new Coordinate('A', 2, $coordinateSystem);
$microPlateCoordinate2 = new Coordinate('A', 3, $coordinateSystem);

$wellContent1 = 'foo';
$microPlate->addWell($microPlateCoordinate1, $wellContent1);

$wellContent2 = 'bar';
$microPlate->addWell($microPlateCoordinate2, $wellContent2);

// retrieve wells from plate
$microPlate->wells
```


See [tests](tests).

## Changelog

Expand Down
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mll-lab/microplate",
"type": "library",
"description": "PHP package to easily convert and work with microplate data",
"description": "PHP package to easily work with microplate data",
"homepage": "https://github.com/mll-lab/microplate",
"license": "MIT",
"authors": [
Expand All @@ -12,15 +12,18 @@
],
"require": {
"php": "^7.4 || ^8",
"illuminate/support": "^6 || ^7 || ^8",
"illuminate/support": "^7 || ^8",
"myclabs/php-enum": "^1.7",
"thecodingmachine/safe": "^1"
},
"require-dev": {
"ergebnis/composer-normalize": "^2",
"infection/infection": "~0.25",
"jangregor/phpstan-prophecy": "^1",
"laravel/framework": "^7 || ^8",
"mll-lab/php-cs-fixer-config": "^4.3",
"nunomaduro/larastan": "^1.0",
"orchestra/testbench": "^5 || ^6",
"phpstan/extension-installer": "^1",
"phpstan/phpstan": "^1",
"phpstan/phpstan-deprecation-rules": "^1",
Expand Down
Loading

0 comments on commit b25b1d3

Please sign in to comment.