HeloiseS / hoki

Bridging the gap between observation and theory
https://heloises.github.io/hoki/intro.html
BSD 3-Clause "New" or "Revised" License
47 stars 8 forks source link

[BUG] #38

Closed RyotaInagaki1 closed 4 years ago

RyotaInagaki1 commented 4 years ago

Describe the bug I first import the following: import hoki from hoki.age_utils import AgeWizard from hoki.cmd import CMD

When I create a valid CMD object mycmd and use the mycmd.plot(log_age=6.5), I get an error that reads "min() arg is an empty sequence"

To Reproduce Change input the set_models_path to the vaild models file in your computer. Also change the paths to valid locations of the involved input files (input_bpass_z020_bin_imf135all_100). Run the attached code:

import hoki
from hoki import load
import hoki.load
from hoki.load import set_models_path
from hoki.age_utils import AgeWizard
from hoki.cmd import CMD
import numpy as np
import matplotlib.pyplot as plt
set_models_path(path='/g/lu/scratch/ryotainagaki/BPASS/bpass-v2.2-newmodels/')
mcmd=CMD('/g/lu/scratch/ryotainagaki/BPASS/bpass_v2.2.1_imf135all_100/input_bpass_z020_bin_imf135all_100')
mcmd.make(mag_filter='V', col_filters=['U', 'V'])
mcmd.plot(log_age=6.5)

Expected behavior I expected the code to display the color magnitude diagram of at age 10^6.8 years.

Desktop (please complete the following information): Windows 10. Browser: Google Chrome (ssh'ed into remote computer)

Additional context models_path: /g/lu/scratch/ryotainagaki/BPASS/bpass-v2.2-newmodels outputs_path: /home/fste075/BPASS_hoki_dev/bpass_v2.2.1_imf135_300 I ran the command that you gave in the beginning of the CMD tutorial.

HeloiseS commented 4 years ago

Hi!

Thanks for your bug report - it is extremely valuable to the hoki development team!

I have a couple of questions that will help us identify the problem: 1) What version of hoki are your running? 2) Could you please restart the kernel (if you are running it in a jupyter notebook), run the code again and send us the full traceback for your error? (i.e copy paste the full error message)

We will get back to you as soon as possible, and don't hesitate to contact us if you have any other questions.

Kind regards, Heloise

RyotaInagaki1 commented 4 years ago

Nevermind. I think this was me forgetting to reload my notebook after the set_models_path. I apologize for the inconvenience.

HeloiseS commented 4 years ago

Thanks for your update! And don't apologise šŸ™ Thanks to your feedback I am about to add a new check to the code so that if this happens in the future, hoki can tell the user to reload and check that set_model_path was called right!

This will save time for future users šŸ˜

Have a great day and don't hesitate to get in touch if you encounter any other problem!