Giter VIP home page Giter VIP logo

hoki's People

Contributors

findesgh avatar glebgeinke avatar heloises avatar krytic avatar maxbriel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hoki's Issues

[BPASS] Generate isochrone from BPASS

Hi,

I am currently working on a project that needs to simulate a stellar population by assuming a star formation history/rate. I have been doing this with the fsps code where we can generate an isochrone containing the luminosity, effective temperature, and weights of stars with different masses at each age, then I take those and sample based on the desired sfr. However, unlike for MIST isochrones, fsps cannot do this for BPASS, since individual stars are unavailable here. I was wondering if something along this line could be done with Hoki.

The end goal is to obtain a composite stellar population with H-R diagrams and CMDs. All we will need is a list of stars at each age of the population, with weights, luminosity, and effective temperature included (or magnitudes at different bands for CMD). It would be quite helpful if assuming an IMF is possible, e.g. Salpeter.

I have noticed the hr_diagram.stack function in Hoki, and was wondering if it is possible to assign weights to each age bin when stacking, and if a similar function is available in hoki.cmd to achieve a similar purpose. For this purpose, I was also wondering if there can be a color bar that indicates the approximate value of each square in the HR diagram/CMD Hoki makes, or a method to extract each value of the squares.

Thanks in advance!

[BPASS] Non-visible compact remnants

For the NEWSEC stellar evolution models, I believe that there may be -inf or inf in the columns, correct? Are the compact remnant primaries reflected in the quantity M2 for the NewSec models?
Are neutron stars and black holes visible in the individual stellar evolution models?
And although it may be ridiculous to ask, is it true that none of the single star or primary stars in the NEWBINMODS models in BPASS are non-visible remnants (neutron star, black hole)?

Question Regarding BPASS models

Do the BPASS binary stellar population models used for Hoki include single stars? This is since in the BPASS v2.2 release paper it is stated that "In BPASS v2.2 we implement a new set of weighting parameters for binary fraction, period and mass ratio dis-
tribution, as a function of the mass of the primary star. We base our new binary parameter distribution on those deter-
mined by the detailed study of Moe & Di Stefano (2017, hereafter MS17) . . ." (Stanway et. al 2018).

[BPASS] Failed installation of hoki

Hello,

I tried to install BPASS following the command: sudo -H pip3 install --user hoki
It seems like the installation is good, but unfortunately I cannot import hoki after the installation. I tried several times in different conda environment, but all failed. I am appreciated if you can help!

Xinfeng

System: macOS, Mojave, v10.14
Log:

(BPASS2) Macintosh-4:python3.7 xuxinfeng$ sudo -H pip3 install --user hoki
Collecting hoki
Downloading hoki-1.5.1.tar.gz (62.7 MB)
|████████████████████████████████| 62.7 MB 26.6 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: wheel in /Users/xuxinfeng/anaconda/envs/BPASS2/lib/python3.7/site-packages (from hoki) (0.36.2)
Collecting corner
Downloading corner-2.1.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: setuptools>=40.6.0 in /Users/xuxinfeng/anaconda/envs/BPASS2/lib/python3.7/site-packages (from corner->hoki) (51.0.0.post20201207)
Collecting matplotlib
Downloading matplotlib-3.3.3-cp37-cp37m-macosx_10_9_x86_64.whl (8.5 MB)
|████████████████████████████████| 8.5 MB 19.9 MB/s
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /Users/xuxinfeng/anaconda/envs/BPASS2/lib/python3.7/site-packages (from matplotlib->hoki) (2.4.7)
Requirement already satisfied: python-dateutil>=2.1 in /Users/xuxinfeng/anaconda/envs/BPASS2/lib/python3.7/site-packages (from matplotlib->hoki) (2.8.1)
Collecting cycler>=0.10
Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Requirement already satisfied: six in /Users/xuxinfeng/anaconda/envs/BPASS2/lib/python3.7/site-packages (from cycler>=0.10->matplotlib->hoki) (1.15.0)
Collecting kiwisolver>=1.0.1
Downloading kiwisolver-1.3.1-cp37-cp37m-macosx_10_9_x86_64.whl (61 kB)
|████████████████████████████████| 61 kB 15.6 MB/s
Collecting numpy
Downloading numpy-1.19.4-cp37-cp37m-macosx_10_9_x86_64.whl (15.3 MB)
|████████████████████████████████| 15.3 MB 36.5 MB/s
Collecting pillow>=6.2.0
Downloading Pillow-8.0.1-cp37-cp37m-macosx_10_10_x86_64.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 63.0 MB/s
Collecting emcee
Downloading emcee-3.0.2-py2.py3-none-any.whl (41 kB)
|████████████████████████████████| 41 kB 2.0 MB/s
Collecting pandas
Downloading pandas-1.1.5-cp37-cp37m-macosx_10_9_x86_64.whl (10.0 MB)
|████████████████████████████████| 10.0 MB 35.8 MB/s
Collecting pytz>=2017.2
Downloading pytz-2020.4-py2.py3-none-any.whl (509 kB)
|████████████████████████████████| 509 kB 38.1 MB/s
Collecting pysynphot
Downloading pysynphot-1.0.0.tar.gz (10.8 MB)
|████████████████████████████████| 10.8 MB 58.0 MB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Collecting astropy
Downloading astropy-4.2-cp37-cp37m-macosx_10_9_x86_64.whl (6.5 MB)
|████████████████████████████████| 6.5 MB 18.9 MB/s
Collecting beautifulsoup4
Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
|████████████████████████████████| 115 kB 34.7 MB/s
Collecting soupsieve>1.2
Downloading soupsieve-2.1-py3-none-any.whl (32 kB)
Collecting pyerfa
Downloading pyerfa-1.7.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (304 kB)
|████████████████████████████████| 304 kB 47.3 MB/s
Collecting pyyaml
Downloading PyYAML-5.3.1.tar.gz (269 kB)
|████████████████████████████████| 269 kB 37.2 MB/s
Collecting setuptools-scm
Using cached setuptools_scm-5.0.1-py2.py3-none-any.whl (28 kB)
Building wheels for collected packages: hoki, pysynphot, pyyaml
Building wheel for hoki (PEP 517) ... done
Created wheel for hoki: filename=hoki-1.5.1-py3-none-any.whl size=46275217 sha256=9d4e39a5d173b6f46bc135681b0fa90a683703f3ace99422efc936bb59bc62e5
Stored in directory: /private/var/root/Library/Caches/pip/wheels/38/82/d7/449dbfceba1a71b7c4925df341f6ebd90b2e3ded866f6b70d1
Building wheel for pysynphot (PEP 517) ... done
Created wheel for pysynphot: filename=pysynphot-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl size=6688690 sha256=a68563d501a8273d610f41146f6da9944cce9b2fef57e78407ea617dc7f33304
Stored in directory: /private/var/root/Library/Caches/pip/wheels/45/54/e5/ded461804aa36e39001f9bfc4867261b47834c437a3c85e69d
Building wheel for pyyaml (setup.py) ... done
Created wheel for pyyaml: filename=PyYAML-5.3.1-cp37-cp37m-macosx_10_9_x86_64.whl size=44626 sha256=1406a471a7319b44faa02a858e33f93c2988360e4147443aa1e7919e22733f4b
Stored in directory: /private/var/root/Library/Caches/pip/wheels/5e/03/1e/e1e954795d6f35dfc7b637fe2277bff021303bd9570ecea653
Successfully built hoki pysynphot pyyaml
Installing collected packages: numpy, soupsieve, pyerfa, pillow, kiwisolver, cycler, setuptools-scm, pytz, matplotlib, beautifulsoup4, astropy, pyyaml, pysynphot, pandas, emcee, corner, hoki
WARNING: The scripts f2py, f2py3 and f2py3.7 are installed in '/var/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
NOTE: The current PATH contains path(s) starting with ~, which may not be expanded by all applications.
WARNING: The scripts fits2bitmap, fitscheck, fitsdiff, fitsheader, fitsinfo, samp_hub, showtable, volint and wcslint are installed in '/var/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
NOTE: The current PATH contains path(s) starting with ~, which may not be expanded by all applications.
WARNING: The script astropy-package-template-example is installed in '/var/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
NOTE: The current PATH contains path(s) starting with ~, which may not be expanded by all applications.
Successfully installed astropy-4.2 beautifulsoup4-4.9.3 corner-2.1.0 cycler-0.10.0 emcee-3.0.2 hoki-1.5.1 kiwisolver-1.3.1 matplotlib-3.3.3 numpy-1.19.4 pandas-1.1.5 pillow-8.0.1 pyerfa-1.7.1.1 pysynphot-1.0.0 pytz-2020.4 pyyaml-5.3.1 setuptools-scm-5.0.1 soupsieve-2.1

(BPASS2) Macintosh-4:python3.7 xuxinfeng$ python
Python 3.7.9 (default, Aug 31 2020, 07:22:35)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

import hoki
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'hoki'
exit()

[BPASS] Phases of individual stellar models?

Is there a 1 to 1 and user accessible mapping from stellar model to the phase (pre-main sequence, main sequence, white dwarf, black hole, neutron star, etc.) in the BPASS stellar model and stellar population directories?

AttributeError: 'CMD' object has no attribute 'filter1'

When running "Loading a pickled CMD file" in Colour Magnitude Diagrams.ipynb (for the JOSS review) and plotting the pickled_cmd object, like so:

pickled_cmd = unpickle(path='./data/cmds/cmd_bv_z020_bin_imf135_300')
plt.figure(figsize=(8,6))
myplot = pickled_cmd.plot(log_age=6.8)
myplot.set_xlabel('B-V', fontsize=14)
myplot.set_ylabel('V', fontsize=14)
myplot.set_xlim([-1,2.0])
myplot.set_ylim([2,-10])

I get the following error.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-d0a7f5d108fd> in <module>
      1 plt.figure(figsize=(8,6))
      2 
----> 3 myplot = pickled_cmd.plot(log_age=6.8)
      4 myplot.set_xlabel('B-V', fontsize=14)
      5 myplot.set_ylabel('V', fontsize=14)

~/.local/lib/python3.7/site-packages/hoki/cmd.py in plot(self, log_age, loc, cmap, **kwargs)
    336         cm_diagram.invert_yaxis()
    337 
--> 338         cm_diagram.set_ylabel(self.filter1)
    339         cm_diagram.set_xlabel(self.filter1+"-"+self.filter2)
    340 

AttributeError: 'CMD' object has no attribute 'filter1'

[DOCS] Corner dependency not mentioned in README

Describe the bug
A dependency on the package corner in the test_stats.py. Possibly in other places. This dependency is not mentioned in the hoki README.

Expected behavior
have the dependency mentioned in the hoki README

[BPASS] HR diagrams - unresolved or resolved binaries?

Hi, I see with HOKI one can plot HR diagrams of single or binary stellar populations. How are the binaries treated in the HR diagrams? Is a binary system considered as an unresolved object on the diagram or as two stars that can be located in different parts of the diagram?

I guess it's the latter since the HR diagrams use parameters of logTe or logG, which can only be defined for individual stars, not for unresolved binaries. However, unresolved binaries seem to be more common in astronomy. So I'm confused.

Thank you!

[BPASS] Regarding NEWSECMODS

Dear Dr. Stevance and Dr. Eldridge,
I am wondering why the NEWSECMODS start at age 0.0 since, intuitively, stars do not start their lifetimes as compact remnants. How do I get the true initial (ZAMS) masses of the NEWSECMODS model's primary and companion?
Thank You,
Ryota Inagaki
(Edited)

[BPASS] Model mass vs Current Mass

Inside the stellar evolution model files, does the column for M1 count as the current mass for the corresponding models for the specified age? Or is it an initial mass (something like Zero Age Main Sequence mass)?

[FEATURE] BPASS colour-magnitude diagrams with more filters

It is very exciting to see the new HOKI version which provides colour-magnitude diagrams, which are very useful for observational astronomers.

However, many people may depend on different filters that have not yet been incorporated by the current BPASS version.

I know it requires a larger amount of effort to calculate synthetic magnitudes for more filter systems.

Is there a way that allows the users to calculate synthetic magnitudes manually with their own filter response curves? Will you consider this in future BPASS and HOKI versions?

[BPASS]

In the Stellar Models' Binary models directory, there is a subdirectory for binary models and secondary models. Is the directory for binary models the one whose M1 value is the mass of the primary star?
In the stellar evolution models, how can the compact object of the star or primary or secondary be discerned?
Also, is the second column of the BPASS Stellar input the total mass of the stellar system, the current mass of the primary star, or is it the initial mass of the star?

Make CMD at particular age available

There is no intuitive way to make a single CMD grid (at a particular age) available - although it is accessible.
It would be nice to make this easy peasy..

Maybe the CMD object should allow indexing (and the index would be the time bins) + feature to do mycmd.get_age(log_age=bla)?

[BPASS] mass of secondaries

Is it possible to find the initial mass of the secondaries in the NEWSECMODS stellar models and in the binary stellar models.

Related package

I just wanted to make you aware of this little package I've written.

It's intended for people who need spectral data for large numbers of stellar particles from hydro simulations. Obviously, hoki aims to provide much broader functionality, but as far as I can tell it's missing this feature.

I would also not be opposed to merging things into hoki at some point and if you believe that would make sense.

Cheers :-).

[BPASS] Initial mass of NEWSEC models and Binary QHE Models

How do I find the initial masses and separation of the primary star and the secondary star in the NEWSEC models and for the binary QHE models? Should I look at the filenames for indications of the primary mass and the secondary mass or should I look at row in the model grid corresponding to age=0 years?
Also, are all binary QHE models listed in metallicities of hmg?
Thank You,
Ryota Inagaki

[BUG] Path values assume a UNIX system

Describe the bug
In, for example, hoki/constants.py, L159:

path_to_settings = data_path+'/settings.yaml'

On a Windows system, this will fail as the directory separator is \ in Windows environments.

This should be replaced with something like (from the standard library os):

path_to_settings = os.path.join(data_path, 'settings.yaml')

which will apply the right directory separator for the right OS.

To Reproduce
n/a

Expected behavior
n/a

Screenshots
n/a

Desktop (please complete the following information):
n/a

Additional context
n/a

Add a feature to HRDs to get age PDF

Context

Knowing the Luminosity and Temperature of am observed star or cluster we can place them on the HRD and find which BPASS HRD bin they fall into. From this we can plot the probabilities of that particular bin being filled at each time step and normalise, giving us an age probability distribution.

Feature Requirements

Given an observed luminosity and temperature, the age pdf should be returned.
Given a table of observed luminosities and temperature the age pdfS should be returned

=> This will probably be best done in a pandas data frame where the ages bins are columns and the rows are a set of L and T, i.e. individual objects.

[BPASS] BPASS Time Bins For Stellar System Models

Do BPASS time bins apply for the individual stellar system models? In other words, are BPASS stellar system models (i.e. the files that are in HOKI.MODELS_PATH) meant to hold information for just the ages in the range 6.0 <= log10(age) <= 11.0?
I am asking this since the HOKI CMD.py uses time bins (for 6.0, 6.1, ..., 11.0 in log10(age)) even though it directly accesses the BPASS stellar system models.

[BUG] tox is very broken - fix my github action

If you are a hoki user - what does this mean for you?

It means dev1.7 is not properly tested on python 3.6, 3.7 and older version of numpy.
It SHOULD work - but my continuous integration is just broken (for now)

Make general function to select BPASS models on condition

Context

The BPASS dummy array has something like 90 columns - I should be able to select my models based on the value of any of these columns or any combinations.

Feature Requirements

This function will basically be the main search function of hoki, it needs to be intuitive and versatile. It should:

  • Allow people to add condition to any number of columns
  • It has to be usable when building CMDs.

default BPASS version is 221. Can't use filters from 222

HokiKeyError: One or both of the chosen filters do not correspond to a valid filter key. from cmd.py

Try/except checks filters against columns in self.dummy_dict[key], where

  •    **self.dummy_dict=dummy_dicts[bpass_version]**
    

and

  •   **bpass_version=DEFAULT_BPASS_VERSION** (which is set to v221 in settings.yaml)
    

Just changing that to v222 helps

[BUG]

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.

[BPASS] Merger or not a Merger Marker in Stellar Evolution Model

Is there a way to find out whether a Stellar Evolution model is a merger model or that of a single star secondary models without looking at the BPASS Stellar Population input (i.e. used-for-CMD-codes) files?

Also, what is the difference between a QHE Binary and a regular binary system?

Age Wizard Name Issue

When loading data, if the name of stars have spacing and other symbols within the string, error when initializing Age Wizard.
Screen Shot 2020-10-21 at 12 25 22 PM

To Reproduce
File attached to Reproduce.

Desktop (please complete the following information):

  • OS: macOS Catalina

[BPASS] hmg files and naming convention

Are all QHE-binary BPASS evolution models in the subdirectories of NEWSINMODS that are named in the format of hmg?
Also, to be extra sure, should I look at the Age=0.0 years value of the M2 value of the evolution model to find the initial secondary star mass of the hmg models?

[DOCS] Add Documentation initial bin

The initial bin in the HR Diagrams and the CMD is not the actual initial bin size. This is done to fudge the probabilities to appear correctly. Otherwise, the probability of the initial bin can take over the other bins due to its size. This information needs to be mentioned in the Documentation.

Possibly, it might also be necessary to look at the reason why the initial bin does still contain a large number of stars. (due to its size?)

[BUG]Csp tests don't pass


test_eventrate.py:23: in <module>
    class TestCSPEventRate():
test_eventrate.py:35: in TestCSPEventRate
    return_edges=True)
../eventrate.py:74: in calculate_rate_over_time
    utils._type_check(metallicity, sfh)
E   AttributeError: module 'hoki.csp.utils' has no attribute '_type_check'
____________________________________________________________________________ ERROR collecting hoki/csp/tests/test_spectra.py _____________________________________________________________________________
../utils.py:140: in load_spectra
    spectra = pd.read_pickle(f"{data_folder}/all_spectra-{star}-{imf}.pkl")
../../../../.local/lib/python3.7/site-packages/pandas/io/pickle.py:170: in read_pickle
    f, fh = get_handle(fp_or_buf, "rb", compression=compression, is_text=False)
../../../../.local/lib/python3.7/site-packages/pandas/io/common.py:434: in get_handle
    f = open(path_or_buf, mode)
E   FileNotFoundError: [Errno 2] No such file or directory: '/home/fste075/hoki/hoki/data/spectra/all_spectra-bin-imf135_300.pkl'

During handling of the above exception, another exception occurred:
test_spectra.py:16: in <module>
    class TestCSPSSpectra(object):
test_spectra.py:21: in TestCSPSSpectra
    CSP = CSPSpectra(f"{data_path}/spectra")
../spectra.py:27: in __init__
    self.bpass_spectra = utils._normalise_spectrum(utils.load_spectra(data_folder, binary=binary))
../utils.py:149: in load_spectra
    data = hoki.load.model_output(f"{data_folder}/spectra-{star}-{imf}.z{metallicity}.dat")
../../load.py:206: in model_output
    assert os.path.isfile(path), "HOKI ERROR: This file does not exist, or its path is incorrect."
E   AssertionError: HOKI ERROR: This file does not exist, or its path is incorrect.
-------------------------------------------------------------------------------------------- Captured stdout ---------------------------------------------------------------------------------------------
Allocating memory
Loading metallicity: em5
_____________________________________________________________________________ ERROR collecting hoki/csp/tests/test_utils.py ______________________________________________________________________________
test_utils.py:16: in <module>
    class TestLoadFiles(object):
test_utils.py:25: in TestLoadFiles
    x = utils._load_files(f"{data_path}/supernova", "supernova")
E   AttributeError: module 'hoki.csp.utils' has no attribute '_load_files'
======================================================================================== short test summary info =========================================================================================
ERROR test_eventrate.py - AttributeError: module 'hoki.csp.utils' has no attribute '_type_check'
ERROR test_spectra.py - AssertionError: HOKI ERROR: This file does not exist, or its path is incorrect.
ERROR test_utils.py - AttributeError: module 'hoki.csp.utils' has no attribute '_load_files'

[BPASS] Model_IMF, Mixed_IMF, Mixed_Age

What does Model_IMF and Mixed_IMF signify in the BPASS-Input file? What does mixed IMF signify physically?
I am referring to Model_IMF and Mixed_IMF as referred to in the cmd,py file.

[BPASS] Data Types in the individual stellar models

In which specific columns of the .dat files representing the BPASS stellar models may there be non floating point values? What do those non-floating point values signify physically?
From,
Ryota Inagaki

BPASS "numbers" files

I don't think the current version of hoki works with the numbers files. I try to make a plot of O stars vs time and get a weird output and when I try to print the values of the number of O stars or ages I get something that looks like this:

" log_age ... WC_lL
NaN 0 . 6 0 0 0 0 0 0 E + 0 1 NaN 0 . 1 7 8 2 3 9 9 E + 0 4 NaN 0 . 2 3 7 2 2 1 6 E + 0 3 NaN 0 . 5 6 4 9 6 4 8 E + 0 1 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 4 4 3 3 4 5 6 E - 0 2 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 1 6 5 7 2 6 0 E + 0 4 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 3 4 2 4 8 6 4 E + 0 5 NaN 0 . 2 5 0 7 5 9 1 E + 0 5 NaN 0 . 1 8 3 2 7 8 8 E + 0 6 NaN 0 . 2 0 7 1 1 5 9 E + 0 6 NaN 0 . 6 7 7 7 5 7 8 E + 0 6 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 0 0 0 ... NaN
1 0 0 0 0 0 E + 0 1 NaN 0 . 1 8 3 6 1 1 8 E + 0 4 NaN 0 . 2 5 7 1 9 0 1 E + 0 3 NaN 0 . 2 1 9 5 9 4 4 E + 0 2 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 0 0 0 0 E + 0 0 NaN 0 . 0 0 0 "

My guess is that columns are getting confused or the code doesn't like NaNs!

[BUG] Error message in hrdiagrams.stack is incorrect.

Describe the bug
The error message for an invalid age_range in hrdiagrams.stack is incorrect. For the file hrs-bin-imf135_300.z020.dat, requesting an age_range of [6.0, 11.0] produces an error:

Traceback (most recent call last):
  File "testhoki.py", line 11, in <module>
    my_plot = hr.plot(age_range=age_range)
  File "/home/sean/Desktop/hoki/hoki/hrdiagrams.py", line 319, in plot
    self.stack(age_range[0], age_range[1])
  File "/home/sean/Desktop/hoki/hoki/hrdiagrams.py", line 188, in stack
    raise HokiFatalError("The age range requested is outside the valid range"
hoki.utils.exceptions.HokiFatalError: The age range requested is outside the valid range(6.0 to 11.1 inclusive)6.0 11.0

To Reproduce
Download the hrs-bin-imf135_300.z020.dat file from BPASS,

Simple reproducing code:

from hoki import load
import matplotlib.pyplot as plt
import numpy as np

file = 'hrs-bin-imf135_300.z020.dat'
hr_type = 'TL'
age_range = [6.0, 11.0]

hr = load.model_output(file, hr_type=hr_type)

my_plot = hr.plot(age_range=age_range)

plt.xlim(5, 3.3)
plt.axvline(3.5)
my_plot.set_title(f"{file} -- type: {hr_type} (stacked ages from {age_range[0]} to {age_range[1]})")
plt.show()

Expected behavior
Either a consistent error message, or the stack to be created.

Screenshots
n/a

Desktop (please complete the following information):

  • OS: Ubuntu 20.04.3
  • Version: Release branch (1.6.0)

Additional context
n/a

Table of Content missing pages

The ToC is missing the AgeWizard when accessing sub-pages. The AgeWizard page is not visible from any of the sub-pages, such as Transient Rates, HR Diagrams, ..., Colour Magnitide diagrams.

The "intro.html" and "index.html" page do show AgeWizard, but the former also shows several sub-headers as main pages. Maybe this is intentional?

Installing hoki from source

For the JOSS review, I tried to install hoki from Github by python setup.py install. The installation finished with a few warnings/errors:

git submodule command failed unexpectedly:
error: pathspec 'astropy_helpers' did not match any file(s) known to git.
Downloading 'astropy-helpers'; run setup.py with the --offline option to force offline installation.
.
.
.
reading manifest template 'MANIFEST.in'
warning: no files found matching 'CHANGES.rst'
warning: no files found matching '*.pyx' under directory 'hoki'
warning: no files found matching '*.c' under directory 'hoki'
warning: no files found matching '*.pxd' under directory 'hoki'
warning: no files found matching '*' under directory 'cextern'
warning: no files found matching '*' under directory 'scripts'
no previously-included directories found matching 'build'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/api'
warning: no files found matching 'astropy_helpers/README.rst'
warning: no files found matching 'astropy_helpers/CHANGES.rst'
warning: no files found matching 'astropy_helpers/LICENSE.rst'
warning: no files found matching '*' under directory 'astropy_helpers/licenses'
warning: no files found matching 'astropy_helpers/ah_bootstrap.py'
warning: no files found matching '*.py' under directory 'astropy_helpers/astropy_helpers'
warning: no files found matching '*.pyx' under directory 'astropy_helpers/astropy_helpers'
warning: no files found matching '*.c' under directory 'astropy_helpers/astropy_helpers'
warning: no files found matching '*.h' under directory 'astropy_helpers/astropy_helpers'
warning: no files found matching '*.rst' under directory 'astropy_helpers/astropy_helpers'
warning: no files found matching '*' under directory 'astropy_helpers/astropy_helpers.egg-info'
warning: no files found matching '*' under directory 'astropy_helpers/astropy_helpers/sphinx'
no previously-included directories found matching 'astropy_helpers/build'
no previously-included directories found matching 'astropy_helpers/astropy_helpers/tests'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.o' found anywhere in distribution
.
.
.

Although the code passed the tests, and tutorial notebooks didn't give any errors, it might be useful to look into the above warnings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.