semvec/pypi-packages huggingface dataset:
wellpvt 0.1.1
Production well PVT calculations
Requires Python: >=3.6

Define pressure and temperature of a producing well, and get PVT properties of oil and gas produced.

## Installation
`$ pip install wellpvt`

## Project Highlights
- single-phase properties
    - **oil**: density, specific gravity
    - **gas**: pseudo-critical properties, compressibility, density, formation volume factor, viscosity
- multiphase mixture properties TBA

## Example Usage
define produced oil with 40 deg. API  

`from wellpvt import Oil`  
     
`oil = Oil(40)`   

`print(oil.api)`    
\>> `40`  

`print(round(oil.calculate_sg(), 3))`    
\>> `0.825`     

`print(round(oil.calculate_density(), 1))`    
\>> `51.5`     

## License
wellpvt is licensed under the MIT License
diagram2vec 0.0.2
Vector Representations of Persistence Diagrams
Requires Python: >=3.6

# diagram2vec

Diagram2vec provides the following finite-dimensional vector representations of the persistence diagrams:

- persistence statistics (statistics of quanitites such as persistence, midlife, mult.life)
- Euler characteristic curve
- k-th Betti number curves
- persistence curves (curves of quanitites such as persistence, midlife, multitplicative life)
- entropy curves (curves of entropy of quanitites such as persistence, midlife, multitplicative life)
- Adcock-Carlsson polynomials (https://arxiv.org/abs/1304.0530)

All representations have &epsilon;-robust versions, i.e. not taking into account intervals with persistence below a certain threshold function.

## Installation

### Dependencies

- python (>= 3.6)
- numpy
- scipy

The latest version of the diagram2vec can be installed with pip:

```
pip install diagram2vec
```

## Example of usage

```python
import diagram2vec

# list of lists of ndarrays, representing a collection of persistence diagrams
diagrams = [
    [np.array([[0.0, np.inf], [0.0, 0.4], [0.0, 0.5]]), np.array([[0.1, 0.6], [0.2, 0.4]])], 
    [np.array([[0.0, np.inf], [0.0, 0.1]]), np.array([[0.4, 0.7]])],
]

# compute a list of statistics of a distribution of the persistence p := (d - b) quantity
stats = diagram2vec.statistics(diagrams, quantity="persistence", statistics=["min", "mean", "count"])

# compute an Euler characteristic curve (a vector of dimension 10)
euler_curve = diagram2vec.euler_curve(diagrams, m=10)

# compute a Betti number curve, which is default quantity for the `persistence_curve`
# (a vector of dimension 50, intervals with persistence below 0.05 are not used)
betti_curve = diagram2dec.persistence_curve(diagrams, m=50, f="linear", b=0.05)

# compute a curve of persistence quantity
# available quanities: 'betti', 'persistence', 'midlife', 'multlife'
persistence_curve = diagram2vec.persistence_curve(diagrams, quantity="persistence", m=50)

# compute a curve of midlife entropy
# available quanities: 'persistence', 'midlife', 'multlife'
entropy_curve = diagram2vec.entropy_curve(diagrams, quantity="midlife", m=20)

# compute Adcock-Carlsson polynomials
polynomials = diagram2vec.polynomials(diagrams, terms=[["birth", "persistence"], ["dmax", "persistence"]], powers=[[1, 1], [2, 4]])
```
gregorian 0.0.9
A calendar wrapper

# Gregorian
Managing irregular calendars isn't hard per-se, but it can be painful, especially in the context of trading calendars and backtesting. That is why gregorian exposes a nifty `Calendar` class to work with custom calendars.

## Installation
The best - and easiest - way to install `Gregorian` is by calling:
```python
pip install gregorian 
```

## Usage
```python
import datetime
from gregorian import Calendar, utils

#every day in 2019
#you can load up your own dates from a backend, API, file...
calendar = Calendar([datetime.date(2019,1,1) + datetime.timedelta(i) for i in range(365)])

#weekends
weekends = calendar.weekends()

#week days
weekdays = calendar.weekdays()

#first and last date
weekdays.first(), weekdays.last()

#or index
weekdays[0], weekdays[-1]

#slice the calendar
#like normal lists, the Calendar is 0-based, such that slice(10:20) returns the 11th to 20th dates
weekdays[10:20]

#or with a date-like object
#this will be inclusive of the bounds, if they are in the calendar
s2 = weekdays[datetime.date(2019,7,1):datetime.date(2019,12,31)]

#10th weekday each month
b10 = weekdays.groupby("month").apply(lambda cal: cal[10])

#5th to 10th weekday each month
b5to10 = weekdays.groupby("month").apply(lambda cal: cal[5:10])

#lets retrieve holidays from somewhere (API, file...)
holidays = [
    datetime.date(2019, 1, 1), datetime.date(2019, 1, 21), 
    datetime.date(2019, 2, 18), datetime.date(2019, 5, 27),
    datetime.date(2019, 7, 4), datetime.date(2019, 9, 2), 
    datetime.date(2019, 10, 14), datetime.date(2019, 11, 11), 
    datetime.date(2019, 11, 28), datetime.date(2019, 12, 25)
]

#because the calendar class is a sorted set, you have set methods like union, intersection and difference
#business days
workdays = weekdays.difference(holidays)

#... alternatively
workdays = holidays.inverse(datetime.date(2019, 1, 1), datetime.date(2019, 12, 31)).weekdays()

#non-weekend holidays
offdays = weekdays.union(holidays)

#is my birthday a weekday?
datetime.date(2019, 6, 17) in weekdays
>> True

#slicing is inclusive of the two bounds... summer workdays
summer = workdays[datetime.date(2019,6,21):datetime.date(2019,9,20)]

#index of given date in given frequency
workdays.dayof(datetime.date(2019,8,14), "month")
>> 8

#a few utilities
utils.isleap(2016), utils.isleap(datetime.date(2019,6,17))
>> True, False

#end of month
utils.eom(datetime.date(2016,2,14), 0), utils.eom(datetime.date(2016,2,14), -1)
>> datetime.date(2019, 2, 29), datetime.date(2019, 1, 31)

#... number of work days to new Year's eve
#week end, month end, quarter end, semester end or year end... simply ask for it!
workdays.daysto(to="year end", asof=datetime.date(2019, 11, 15))
>> 45
```

## About gregorian
This package is named after the Gregorian calendar, which was itself named after Pope Gregory XIII who introduced it as a correction to the Julian calendar in 1582.