tempun_package
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.7%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: sdam-au
- License: mit
- Language: Python
- Default Branch: main
- Size: 294 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 2
Metadata Files
README.md
tempun
Citation
Vojtěch Kaše. (2022). tempun (Version v0.2). Zenodo. http://doi.org/10.5281/zenodo.4650989
Description
tempun is a Python 3 package to deal with temporal uncertainty in historical & archaeological datasets. Dating of historical artifacts (e.g. inscriptions, books etc.) is typically expressed by means of a dating interval during which it is assumed that the artifact was produced. Commonly, the production itself was much shorter than the interval and did not take more than one year. Therefore, the interval rather expresses uncertainty concerning the actual date of production. The question is how to analyze temporal trends in data revealing such temporal uncertainty.
A way forward is to use the interval to extract probability of production of the artifact. All dates (years) outside of the dating interval have probality p=0; all dates within the interval have probability somehow proportional to the duration of the interval, while the sum of probabilities for all years within the interval has to be equal to 1. This probality has to follow certain distribution. The package works with uniform or trapezoidal distribution. With uniform distribution, each year within the interval has an equal probality to be the year of production of the artifact.
We can use the intervals and the probalities associatiated with them to randomly assign individual dates (years) to each artifact within our dataset. In other words, we can model or simulate the date. We can do this repeatedly, i.e. to each artifact assign a certain number of random dates. This is in the core of a Monte Carlo Simulation (MCS) approach. In the package, it is implemented by means of model_date() function.
Having the random dates, we can proceed to do the analysis. For instance, we can recombine these dates into multiple time series and to compare between them. The package includes a bunch of functions developed for this purpose.
Getting started
The package can be installed via pip:
bash
pip install tempun
To be sure that you have the latest version, use pip install tempun --ignore-installed. To install it directly from Jupyter, use !pip install tempun.
In Python, import the package:
python
import tempun
Documentation (in progress)
model_date()
This function requires at least two parameters:
startstop
If both start and stop are numbers, model_date(start, stop) returns a random number within the range starting with start and ending with stop.
If stop is not a valid number or contains an empty value, start is interpreted as defining a NOT BEFORE date (the so called ante quem*)
If start is not a valid number or contains an empty value, stop is interpreted as defining a NOT AFTER date (the so called post quem)
If start and stop are identical, the function returns the same number as well.
There are three optional parameters:
size=1: how many random numbers you want to get; by default, size=1, i.e. only one number is returnedb: bending point b defining shape of the trapezoidal distribution; by default, b=0, i.e. uniform distribution; set to 0.1 to get trapezoidal distributionscale: scale of the half-uniform distribution used to model ante quem and post quem; by default scale=25
The function returns an individual number (if size=1; i.e. by default) or a list of numbers of length equal to size
```python
example 1: only start and stop
tempun.model_date(-340, -330) -337
example 2: size specified (returns a list of numbers of given size
tempun.model_date(-340, -330, 10) [-334, -333, -332, -336, -332, -338, -333, -336, -333, -331]
example 3: model post quem (with default scale)
tempun.modeldate(114, "", 10, antepost=False) [114, 114, 114, 114, 114, 114, 114, 114, 114, 114] tempun.modeldate(114, "", 10, antepost=True) [123, 143, 123, 149, 123, 155, 125, 115, 128, 132] ```
getsimulationvariants()
```python
getsimulationvariants(randomdateslists) ```
timeblocksplotfromrandom()
```python
timeblocksplotfromrandoms(randomdateslists, timeblocks=None, ax=None, color="black", random_size=None, **kwargs) ```
kdeplotfromrandoms()
```python
kdeplotfromrandoms(randomdateslists, ax=None, color="black", random_size=None, **kwargs) ```
timeblocksplotfromrandoms()
```python
timeblocksplotfromrandoms(randomdateslists, timeblocks=None, ax=None, color="black", random_size=None, **kwargs) ```
Version history
- 0.2.2 - minor bugs fixing
- 0.2.1 - minor bugs fixing
- 0.2 - numerous improvements and simplifications (some new features not compatible with previous versions...)
- 0.1.6 - minor improvements
- 0.1.5 -
antepostargument added, defaultFalse - 0.1.4 - seed argument in model date
- 0.1 - first version
Owner
- Name: Social Dynamics in the Ancient Mediterranean
- Login: sdam-au
- Kind: organization
- Location: Aarhus, Denmark
- Website: sdam.au.dk
- Twitter: sdam_au
- Repositories: 7
- Profile: https://github.com/sdam-au
Research group of social complexity and dynamics in the Ancient Mediterranean
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: tempun
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Vojtěch
family-names: Kaše
email: kase@kfi.zcu.cz
affiliation: University of West Bohemia
orcid: 'https://orcid.org/0000-0002-6601-1605'
repository-code: 'https://github.com/sdam_au/tempun_package'
keywords:
- modelling temporal uncertainty
- historical data analysis
- archaelogical data analysis
- Monte Carlo simulations
- computational history
license: CC-BY-NC-4.0
version: '0.2.2'
date-released: '2022-06-28'
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- matplotlib *
- numpy *
- pandas *
- scipy *
- matplotlib *
- numpy *
- pandas *
- scipy *
- matplotlib *
- numpy *
- pandas *
- scipy *