Git Product home page Git Product logo

Comments (9)

apontzen avatar apontzen commented on August 22, 2024

Thanks for reporting! This does sound strange and I can’t immediately understand what the problem would be.

Could you report the full result of tangos list-possible-properties? And how exactly are you asking for the property class from the name, could you give the exact code?

from tangos.

milchada avatar milchada commented on August 22, 2024

Hi Andrew! Here it is:

tangos list-possible-properties
tangos_properties_uchadaya
                          name |     handler     | property class
-------------------------------+-----------------+-------------------------------------------------------------
           BH_central_distance | PynbodyInputHan | tangos.properties.pynbody.BH.BH
...
                v_disp_profile | PynbodyInputHan | tangos_properties_uchadaya.vdisp.VDispProfile
                             z |       live      | tangos.properties.intrinsic.IntrinsicProperties

v_disp_profile is the property I defined.
I check for the property class in iPython as follows:

import tangos
tangos.properties.providing_class('v_disp_profile')

Here is the batch script I use to add the property to the database:

#PBS -S /bin/bash
#PBS -N db-RC
#PBS -l select=2:ncpus=24:mpiprocs=1:model=bro:bigmem=False
#PBS -l walltime=2:00:00
#PBS -q devel

cd $PBS_O_WORKDIR
module load mpi-sgi/mpt
export TANGOS_PROPERTY_MODULES=tangos_nbodyshop_properties, tangos_properties_uchadaya
export TANGOS_SIMULATION_FOLDER=/nobackupp2/mtremmel/Romulus/
export TANGOS_DB_CONNECTION=/nobackupp2/uchadaya/data_romulusC.db
export SIMS="h1.cosmo50"

mpiexec tangos write v_disp_profile --for $SIMS --type halo --load-mode=server --backend mpi4py --backwards --hmax 1

from tangos.

apontzen avatar apontzen commented on August 22, 2024

OK, so tangos is definitely picking up your module and registering the class, which is good.

The reason tangos.properties.providing_class('v_disp_profile') is because, as the list states, your class is only compatible with pynbody. You have to tell it you'll be providing pynbody data so tangos.properties.providing_class('v_disp_profile', tangos.input_handlers.pynbody.PynbodyInputHandler). The docstring states that, without specifying this, you'll only see live properties.

If your batch script is failing, though, I'm less sure what's going wrong - maybe send a pointer to the output?

from tangos.

milchada avatar milchada commented on August 22, 2024

Ah, I see - specifying the handler did help iPython access the providing class.
The batch job error file is attached.
db-RC.e3960409.txt

from tangos.

apontzen avatar apontzen commented on August 22, 2024

Really weird. Could you try inserting tangos list-possible-properties into the batch script and checking what comes out just to be sure it is picking up in that environment too.

Also, what is tangos.get_simulation("<simulation name>").get_output_handler()?

from tangos.

milchada avatar milchada commented on August 22, 2024

Aha! list-possible-properties in the batch script does not list properties from my module.
Given the submission script above, why would this be the case if iPython knows where to look?

PS The output handler is fine in ipython:
<tangos.input_handlers.pynbody.ChangaInputHandler at 0x7fffc1735c10>

from tangos.

apontzen avatar apontzen commented on August 22, 2024

Hard to know - could it be that somehow your PYTHONPATH is incorrect within PBS, so the module import fails?

That should trigger a warning but maybe somehow it is not showing up.

Maybe try printing something in your module __init.py__ to test if it's being imported in the batch runs?

from tangos.

milchada avatar milchada commented on August 22, 2024

Wow, it turns out the issue is that I specified:
export TANGOS_PROPERTY_MODULES=tangos_nbodyshop_properties, tangos_properties_uchadaya
and that space bar between the module names was the problem! when i removed it, tangos_list_properties shows my property as well.

from tangos.

apontzen avatar apontzen commented on August 22, 2024

Yes, this is not an issue with tangos but rather with parsing in the shell. An alternative way around it is to export TANGOS_PROPERTY_MODULES="tangos_nbodyshop_properties, tangos_properties_uchadaya" - the quotes will stop the space from interfering.

Closing the issue now.

from tangos.

Related Issues (20)

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.