Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
remove initial benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
dougbrn committed Jan 2, 2024
1 parent 92e63d9 commit e96f3c3
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,48 +40,3 @@ def time_prune_sync_workflow():

ens.prune(50) # calc nobs -> cut any object with nobs<50
ens.source.head(5) # should call sync implicitly


def time_basic_workflow():
np.random.seed(1)

# Generate 10 astronomical objects
n_obj = 10
ids = 8000 + np.arange(n_obj)
names = ids.astype(str)
object_table = pd.DataFrame(
{
"id": ids,
"name": names,
"ddf_bool": np.random.randint(0, 2, n_obj), # 0 if from deep drilling field, 1 otherwise
"libid_cadence": np.random.randint(1, 130, n_obj),
}
)

# Create 1000 lightcurves with 100 measurements each
lc_len = 100
num_points = 1000
all_bands = np.array(["r", "g", "b", "i"])
source_table = pd.DataFrame(
{
"id": 8000 + (np.arange(num_points) % n_obj),
"time": np.arange(num_points),
"flux": np.random.random_sample(size=num_points)*10,
"band": np.repeat(all_bands, num_points / len(all_bands)),
"error": np.random.random_sample(size=num_points),
"count": np.arange(num_points),
},
)

ens = Ensemble() # initialize an ensemble object

# Read in the generated lightcurve data
ens.from_pandas(
source_frame=source_table,
object_frame=object_table,
id_col="id",
time_col="time",
flux_col="flux",
err_col="error",
band_col="band",
npartitions=1)

0 comments on commit e96f3c3

Please sign in to comment.